diff --git a/Mile.Cirno/Mile.Cirno.cpp b/Mile.Cirno/Mile.Cirno.cpp index 5964669..64c4daf 100644 --- a/Mile.Cirno/Mile.Cirno.cpp +++ b/Mile.Cirno/Mile.Cirno.cpp @@ -16,15 +16,54 @@ #include #include +NTSTATUS DOKAN_CALLBACK MileCirnoZwCreateFile( + _In_ LPCWSTR FileName, + _In_ PDOKAN_IO_SECURITY_CONTEXT SecurityContext, + _In_ ACCESS_MASK DesiredAccess, + _In_ ULONG FileAttributes, + _In_ ULONG ShareAccess, + _In_ ULONG CreateDisposition, + _In_ ULONG CreateOptions, + _In_ PDOKAN_FILE_INFO DokanFileInfo) +{ + UNREFERENCED_PARAMETER(FileName); + UNREFERENCED_PARAMETER(SecurityContext); + UNREFERENCED_PARAMETER(DesiredAccess); + UNREFERENCED_PARAMETER(FileAttributes); + UNREFERENCED_PARAMETER(ShareAccess); + UNREFERENCED_PARAMETER(CreateDisposition); + UNREFERENCED_PARAMETER(CreateOptions); + UNREFERENCED_PARAMETER(DokanFileInfo); + return STATUS_SUCCESS; +} + +NTSTATUS DOKAN_CALLBACK MileCirnoFindFiles( + _In_ LPCWSTR FileName, + _In_ PFillFindData FillFindData, + _In_ PDOKAN_FILE_INFO DokanFileInfo) +{ + UNREFERENCED_PARAMETER(FileName); + UNREFERENCED_PARAMETER(FillFindData); + UNREFERENCED_PARAMETER(DokanFileInfo); + return STATUS_SUCCESS; +} + int main() { DOKAN_OPTIONS Options = { 0 }; Options.Version = DOKAN_VERSION; Options.SingleThread; - Options.Options; + Options.Options = + DOKAN_OPTION_DEBUG | + DOKAN_OPTION_STDERR | + DOKAN_OPTION_ALT_STREAM | + DOKAN_OPTION_WRITE_PROTECT | + DOKAN_OPTION_MOUNT_MANAGER | + DOKAN_OPTION_CASE_SENSITIVE | + DOKAN_OPTION_DISPATCH_DRIVER_LOGS; Options.GlobalContext; - Options.MountPoint; - Options.UNCName = nullptr; + Options.MountPoint = L"C:\\Windows\\System32\\HostDriverStore"; + Options.UNCName; Options.Timeout; Options.AllocationUnitSize; Options.SectorSize; @@ -32,15 +71,15 @@ int main() Options.VolumeSecurityDescriptor; DOKAN_OPERATIONS Operations = { 0 }; - Operations.ZwCreateFile; + Operations.ZwCreateFile = ::MileCirnoZwCreateFile; Operations.Cleanup; Operations.CloseFile; Operations.ReadFile; Operations.WriteFile; Operations.FlushFileBuffers; Operations.GetFileInformation; - Operations.FindFiles; - Operations.FindFilesWithPattern; + Operations.FindFiles = ::MileCirnoFindFiles; + Operations.FindFilesWithPattern = nullptr; Operations.SetFileAttributesW; Operations.SetFileTime; Operations.DeleteFileW;