Changeset 63073 in vbox
- Timestamp:
- Aug 5, 2016 10:46:32 PM (8 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/SharedFolders/driver
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Win2kWorkarounds.c
r62522 r63073 129 129 130 130 RtlInitUnicodeString(&RoutineName, L"RtlGetVersion"); 131 pfn = (PFNRTLGETVERSION) MmGetSystemRoutineAddress(&RoutineName);131 pfn = (PFNRTLGETVERSION)(uintptr_t)MmGetSystemRoutineAddress(&RoutineName); 132 132 if (!pfn) 133 133 pfn = Fake_RtlGetVersion; 134 ASMAtomicWritePtr( &g_pfnRtlGetVersion,pfn);134 ASMAtomicWritePtr((void * volatile *)&g_pfnRtlGetVersion, (void *)(uintptr_t)pfn); 135 135 136 136 return pfn(pVerInfo); … … 169 169 170 170 RtlInitUnicodeString(&RoutineName, L"PsGetProcessImageFileName"); 171 pfn = (PFNPSGETPROCESSIMAGEFILENAME) MmGetSystemRoutineAddress(&RoutineName);171 pfn = (PFNPSGETPROCESSIMAGEFILENAME)(uintptr_t)MmGetSystemRoutineAddress(&RoutineName); 172 172 if (!pfn) 173 173 pfn = Fake_PsGetProcessImageFileName; 174 ASMAtomicWritePtr( &g_pfnPsGetProcessImageFileName,pfn);174 ASMAtomicWritePtr((void * volatile *)&g_pfnPsGetProcessImageFileName, (void *)(uintptr_t)pfn); 175 175 176 176 return pfn(pProcess); -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.c
r62522 r63073 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VirtualBox Windows Guest Shared Folders 5 * 6 * File System Driver file routines 3 * VirtualBox Windows Guest Shared Folders - File System Driver file routines. 7 4 */ 8 5 -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h
r62522 r63073 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VirtualBox Windows Guest Shared Folders 5 * 6 * File System Driver header file 3 * VirtualBox Windows Guest Shared Folders - File System Driver header file 7 4 */ 8 5 … … 31 28 * System and RX headers. 32 29 */ 33 #include <ntifs.h> 34 #include <windef.h> 35 36 #include "rx.h" 30 #include <iprt/nt/nt.h> /* includes ntifs.h + wdm.h */ 31 #include <iprt/win/windef.h> 32 #include <iprt/nt/rx.h> 37 33 38 34 /* -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.c
r62522 r63073 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VirtualBox Windows Guest Shared Folders 5 * 6 * File System Driver system helpers 3 * VirtualBox Windows Guest Shared Folders - File System Driver system helpers 7 4 */ 8 5 … … 19 16 */ 20 17 21 #include < ntifs.h>22 #include < ntdddisk.h>18 #include <iprt/nt/nt.h> /* includes ntifs.h and wdm.h */ 19 #include <iprt/win/ntdddisk.h> 23 20 24 21 #include "vbsfhlp.h" … … 28 25 #endif 29 26 30 void vbsfHlpSleep 27 void vbsfHlpSleep(ULONG ulMillies) 31 28 { 32 29 KEVENT event; … … 47 44 * 48 45 */ 49 uint32_t VBoxToNTFileAttributes 46 uint32_t VBoxToNTFileAttributes(uint32_t fMode) 50 47 { 51 48 uint32_t FileAttributes = 0; … … 88 85 * 89 86 */ 90 uint32_t NTToVBoxFileAttributes 87 uint32_t NTToVBoxFileAttributes(uint32_t fMode) 91 88 { 92 89 uint32_t FileAttributes = 0; … … 121 118 } 122 119 123 NTSTATUS vbsfHlpCreateDriveLetter 120 NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName) 124 121 { 125 122 UNICODE_STRING driveName; … … 129 126 driveName.Buffer[driveName.Length/sizeof(WCHAR) - 2] = Letter; 130 127 131 return IoCreateSymbolicLink 132 } 133 134 NTSTATUS vbsfHlpDeleteDriveLetter 128 return IoCreateSymbolicLink(&driveName, pDeviceName); 129 } 130 131 NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter) 135 132 { 136 133 UNICODE_STRING driveName; … … 140 137 driveName.Buffer[driveName.Length/sizeof(WCHAR) - 2] = Letter; 141 138 142 return IoDeleteSymbolicLink 139 return IoDeleteSymbolicLink(&driveName); 143 140 } 144 141 … … 150 147 * 151 148 */ 152 NTSTATUS VBoxErrorToNTStatus 149 NTSTATUS VBoxErrorToNTStatus(int vboxRC) 153 150 { 154 151 NTSTATUS Status; … … 241 238 } 242 239 243 PVOID vbsfAllocNonPagedMem 240 PVOID vbsfAllocNonPagedMem(ULONG ulSize) 244 241 { 245 242 PVOID pMemory = NULL; … … 270 267 } 271 268 272 void vbsfFreeNonPagedMem 269 void vbsfFreeNonPagedMem(PVOID lpMem) 273 270 { 274 271 #ifdef DEBUG … … 313 310 #endif 314 311 315 #if defined(DEBUG) || defined (LOG_ENABLED) 312 #if defined(DEBUG) || defined(LOG_ENABLED) 313 316 314 static PCHAR PnPMinorFunctionString(LONG MinorFunction) 317 315 { … … 371 369 PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction) 372 370 { 373 switch (MinorFunction) 374 { 375 case IRP_MJ_CREATE: 376 return "IRP_MJ_CREATE"; 377 case IRP_MJ_CREATE_NAMED_PIPE: 378 return "IRP_MJ_CREATE_NAMED_PIPE"; 379 case IRP_MJ_CLOSE: 380 return "IRP_MJ_CLOSE"; 381 case IRP_MJ_READ: 382 return "IRP_MJ_READ"; 383 case IRP_MJ_WRITE: 384 return "IRP_MJ_WRITE"; 385 case IRP_MJ_QUERY_INFORMATION: 386 return "IRP_MJ_QUERY_INFORMATION"; 387 case IRP_MJ_SET_INFORMATION: 388 return "IRP_MJ_SET_INFORMATION"; 389 case IRP_MJ_QUERY_EA: 390 return "IRP_MJ_QUERY_EA"; 391 case IRP_MJ_SET_EA: 392 return "IRP_MJ_SET_EA"; 393 case IRP_MJ_FLUSH_BUFFERS: 394 return "IRP_MJ_FLUSH_BUFFERS"; 395 case IRP_MJ_QUERY_VOLUME_INFORMATION: 396 return "IRP_MJ_QUERY_VOLUME_INFORMATION"; 397 case IRP_MJ_SET_VOLUME_INFORMATION: 398 return "IRP_MJ_SET_VOLUME_INFORMATION"; 399 case IRP_MJ_DIRECTORY_CONTROL: 400 return "IRP_MJ_DIRECTORY_CONTROL"; 401 case IRP_MJ_FILE_SYSTEM_CONTROL: 402 return "IRP_MJ_FILE_SYSTEM_CONTROL"; 403 case IRP_MJ_DEVICE_CONTROL: 404 return "IRP_MJ_DEVICE_CONTROL"; 405 case IRP_MJ_INTERNAL_DEVICE_CONTROL: 406 return "IRP_MJ_INTERNAL_DEVICE_CONTROL"; 407 case IRP_MJ_SHUTDOWN: 408 return "IRP_MJ_SHUTDOWN"; 409 case IRP_MJ_LOCK_CONTROL: 410 return "IRP_MJ_LOCK_CONTROL"; 411 case IRP_MJ_CLEANUP: 412 return "IRP_MJ_CLEANUP"; 413 case IRP_MJ_CREATE_MAILSLOT: 414 return "IRP_MJ_CREATE_MAILSLOT"; 415 case IRP_MJ_QUERY_SECURITY: 416 return "IRP_MJ_QUERY_SECURITY"; 417 case IRP_MJ_SET_SECURITY: 418 return "IRP_MJ_SET_SECURITY"; 419 case IRP_MJ_POWER: 420 return "IRP_MJ_POWER"; 421 case IRP_MJ_SYSTEM_CONTROL: 422 return "IRP_MJ_SYSTEM_CONTROL"; 423 case IRP_MJ_DEVICE_CHANGE: 424 return "IRP_MJ_DEVICE_CHANGE"; 425 case IRP_MJ_QUERY_QUOTA: 426 return "IRP_MJ_QUERY_QUOTA"; 427 case IRP_MJ_SET_QUOTA: 428 return "IRP_MJ_SET_QUOTA"; 429 case IRP_MJ_PNP: 430 return PnPMinorFunctionString(MinorFunction); 431 432 default: 433 return "unknown_pnp_irp"; 434 } 435 } 436 #endif 371 switch (MajorFunction) 372 { 373 case IRP_MJ_CREATE: 374 return "IRP_MJ_CREATE"; 375 case IRP_MJ_CREATE_NAMED_PIPE: 376 return "IRP_MJ_CREATE_NAMED_PIPE"; 377 case IRP_MJ_CLOSE: 378 return "IRP_MJ_CLOSE"; 379 case IRP_MJ_READ: 380 return "IRP_MJ_READ"; 381 case IRP_MJ_WRITE: 382 return "IRP_MJ_WRITE"; 383 case IRP_MJ_QUERY_INFORMATION: 384 return "IRP_MJ_QUERY_INFORMATION"; 385 case IRP_MJ_SET_INFORMATION: 386 return "IRP_MJ_SET_INFORMATION"; 387 case IRP_MJ_QUERY_EA: 388 return "IRP_MJ_QUERY_EA"; 389 case IRP_MJ_SET_EA: 390 return "IRP_MJ_SET_EA"; 391 case IRP_MJ_FLUSH_BUFFERS: 392 return "IRP_MJ_FLUSH_BUFFERS"; 393 case IRP_MJ_QUERY_VOLUME_INFORMATION: 394 return "IRP_MJ_QUERY_VOLUME_INFORMATION"; 395 case IRP_MJ_SET_VOLUME_INFORMATION: 396 return "IRP_MJ_SET_VOLUME_INFORMATION"; 397 case IRP_MJ_DIRECTORY_CONTROL: 398 return "IRP_MJ_DIRECTORY_CONTROL"; 399 case IRP_MJ_FILE_SYSTEM_CONTROL: 400 return "IRP_MJ_FILE_SYSTEM_CONTROL"; 401 case IRP_MJ_DEVICE_CONTROL: 402 return "IRP_MJ_DEVICE_CONTROL"; 403 case IRP_MJ_INTERNAL_DEVICE_CONTROL: 404 return "IRP_MJ_INTERNAL_DEVICE_CONTROL"; 405 case IRP_MJ_SHUTDOWN: 406 return "IRP_MJ_SHUTDOWN"; 407 case IRP_MJ_LOCK_CONTROL: 408 return "IRP_MJ_LOCK_CONTROL"; 409 case IRP_MJ_CLEANUP: 410 return "IRP_MJ_CLEANUP"; 411 case IRP_MJ_CREATE_MAILSLOT: 412 return "IRP_MJ_CREATE_MAILSLOT"; 413 case IRP_MJ_QUERY_SECURITY: 414 return "IRP_MJ_QUERY_SECURITY"; 415 case IRP_MJ_SET_SECURITY: 416 return "IRP_MJ_SET_SECURITY"; 417 case IRP_MJ_POWER: 418 return "IRP_MJ_POWER"; 419 case IRP_MJ_SYSTEM_CONTROL: 420 return "IRP_MJ_SYSTEM_CONTROL"; 421 case IRP_MJ_DEVICE_CHANGE: 422 return "IRP_MJ_DEVICE_CHANGE"; 423 case IRP_MJ_QUERY_QUOTA: 424 return "IRP_MJ_QUERY_QUOTA"; 425 case IRP_MJ_SET_QUOTA: 426 return "IRP_MJ_SET_QUOTA"; 427 case IRP_MJ_PNP: 428 return PnPMinorFunctionString(MinorFunction); 429 430 default: 431 return "unknown_pnp_irp"; 432 } 433 } 434 435 #endif /* DEBUG || LOG_ENABLED */ 437 436 438 437 /** Allocate and initialize a SHFLSTRING from a UNICODE string. -
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.h
r62522 r63073 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VirtualBox Windows Guest Shared Folders 5 * 6 * File System Driver helpers 3 * VirtualBox Windows Guest Shared Folders - File System Driver helpers 7 4 */ 8 5 … … 18 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 19 16 */ 17 20 18 #ifndef __VBSFHLP__H 21 19 #define __VBSFHLP__H 22 20 23 #include < ntifs.h>24 #include < ntverp.h>21 #include <iprt/nt/nt.h> /* includes ntifs.h and wdm.h */ 22 #include <iprt/win/ntverp.h> 25 23 26 24 #include <VBox/log.h> … … 28 26 29 27 30 void vbsfHlpSleep(ULONG ulMillies);31 NTSTATUS vbsfHlpCreateDriveLetter 32 NTSTATUS vbsfHlpDeleteDriveLetter 28 void vbsfHlpSleep(ULONG ulMillies); 29 NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName); 30 NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter); 33 31 34 32 /** … … 39 37 * 40 38 */ 41 uint32_t VBoxToNTFileAttributes 39 uint32_t VBoxToNTFileAttributes(uint32_t fMode); 42 40 43 41 /** … … 48 46 * 49 47 */ 50 uint32_t NTToVBoxFileAttributes 48 uint32_t NTToVBoxFileAttributes(uint32_t fMode); 51 49 52 50 /** … … 57 55 * 58 56 */ 59 NTSTATUS VBoxErrorToNTStatus 57 NTSTATUS VBoxErrorToNTStatus(int vboxRC); 60 58 61 PVOID vbsfAllocNonPagedMem(ULONG ulSize);62 void vbsfFreeNonPagedMem(PVOID lpMem);59 PVOID vbsfAllocNonPagedMem(ULONG ulSize); 60 void vbsfFreeNonPagedMem(PVOID lpMem); 63 61 64 #if defined(DEBUG) || defined 62 #if defined(DEBUG) || defined(LOG_ENABLED) 65 63 PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction); 66 64 #endif … … 68 66 NTSTATUS vbsfShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb); 69 67 70 #endif /* __VBSFHLP__H */ 68 #endif /* !__VBSFHLP__H */ 69
Note:
See TracChangeset
for help on using the changeset viewer.