CreateFile GetFileTIme SetFileTime

后端 未结 2 973
花落未央
花落未央 2021-01-05 19:33

I\'m having trouble using GetFileTime and SetFileTime when it comes to directories. Specifically I think my problem is that I am new to the WinAPI and I don\'t think I\'m

2条回答
  •  逝去的感伤
    2021-01-05 20:19

    Answer #2: To use CreateFile to get a handle to a directory, you need to use the FILE_FLAG_BACKUP_SEMANTICS flag. Using your example:

    h1 = CreateFile(itemA, GENERIC_READ, FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
    

    I would guess this would work for Answer #4 as well, but I haven't tried it to confirm.

提交回复
热议问题