阅读:1403回复:0
ZwCreateFile如何创建一个目录,请指点以下代码?需要修改什么参数?
OBJECT_ATTRIBUTES objectAttributes;
//UNICODE_STRING fileNameUnicodeString; PUNICODE_STRING fileNameUnicodeString; HANDLE ntFileHandle; IO_STATUS_BLOCK ioStatus; NTSTATUS ntStatus; fileNameUnicodeString= (PUNICODE_STRING)context; InitializeObjectAttributes( &objectAttributes, fileNameUnicodeString, OBJ_CASE_INSENSITIVE, NULL, NULL ); //FILE_CREATE:If the file already exists, replace it with the given file. If it does not, create the given file. ntStatus = ZwCreateFile( &ntFileHandle, SYNCHRONIZE|DELETE,//FILE_ANY_ACCESS, &objectAttributes, &ioStatus, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_CREATE, FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0); |
|