ReactOS  r76032
disk.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: dll/win32/kernel32/client/file/disk.c
5  * PURPOSE: Disk and Drive functions
6  * PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
7  * Erik Bos, Alexandre Julliard :
8  * GetLogicalDriveStringsA,
9  * GetLogicalDriveStringsW, GetLogicalDrives
10  * UPDATE HISTORY:
11  * Created 01/11/98
12  */
13 //WINE copyright notice:
14 /*
15  * DOS drives handling functions
16  *
17  * Copyright 1993 Erik Bos
18  * Copyright 1996 Alexandre Julliard
19  */
20 
21 #include <k32.h>
22 #include <strsafe.h>
23 
24 #define NDEBUG
25 #include <debug.h>
27 
28 #define MAX_DOS_DRIVES 26
29 
30 HANDLE
31 WINAPI
34 {
35  UNICODE_STRING NtPathU;
37  NTSTATUS errCode;
39  HANDLE hFile;
40 
41  if (!RtlDosPathNameToNtPathName_U(DirName, &NtPathU, NULL, NULL))
42  {
43  WARN("Invalid path\n");
45  return INVALID_HANDLE_VALUE;
46  }
47 
48  InitializeObjectAttributes(&ObjectAttributes,
49  &NtPathU,
51  NULL,
52  NULL);
53 
54  errCode = NtCreateFile(&hFile,
56  &ObjectAttributes,
57  &IoStatusBlock,
58  NULL,
59  0,
61  FILE_OPEN,
62  0,
63  NULL,
64  0);
65 
66  RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer);
67 
68  if (!NT_SUCCESS(errCode))
69  {
70  BaseSetLastNTError(errCode);
71  return INVALID_HANDLE_VALUE;
72  }
73 
74  return hFile;
75 }
76 
77 /*
78  * @implemented
79  */
80 /* Synced to Wine-2008/12/28 */
81 DWORD
82 WINAPI
85 {
86  DWORD drive, count;
87  DWORD dwDriveMap;
88  LPSTR p;
89 
90  dwDriveMap = GetLogicalDrives();
91 
92  for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++)
93  {
94  if (dwDriveMap & (1<<drive))
95  count++;
96  }
97 
98 
99  if ((count * 4) + 1 > nBufferLength) return ((count * 4) + 1);
100 
101  p = lpBuffer;
102 
103  for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
104  if (dwDriveMap & (1<<drive))
105  {
106  *p++ = 'A' + (UCHAR)drive;
107  *p++ = ':';
108  *p++ = '\\';
109  *p++ = '\0';
110  }
111  *p = '\0';
112 
113  return (count * 4);
114 }
115 
116 /*
117  * @implemented
118  */
119 /* Synced to Wine-2008/12/28 */
120 DWORD
121 WINAPI
124 {
125  DWORD drive, count;
126  DWORD dwDriveMap;
127  LPWSTR p;
128 
129  dwDriveMap = GetLogicalDrives();
130 
131  for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++)
132  {
133  if (dwDriveMap & (1<<drive))
134  count++;
135  }
136 
137  if ((count * 4) + 1 > nBufferLength) return ((count * 4) + 1);
138 
139  p = lpBuffer;
140  for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
141  if (dwDriveMap & (1<<drive))
142  {
143  *p++ = (WCHAR)('A' + drive);
144  *p++ = (WCHAR)':';
145  *p++ = (WCHAR)'\\';
146  *p++ = (WCHAR)'\0';
147  }
148  *p = (WCHAR)'\0';
149 
150  return (count * 4);
151 }
152 
153 /*
154  * @implemented
155  */
156 /* Synced to Wine-? */
157 DWORD
158 WINAPI
160 {
162  PROCESS_DEVICEMAP_INFORMATION ProcessDeviceMapInfo;
163 
164  /* Get the Device Map for this Process */
167  &ProcessDeviceMapInfo,
168  sizeof(ProcessDeviceMapInfo),
169  NULL);
170 
171  /* Return the Drive Map */
172  if (!NT_SUCCESS(Status))
173  {
174  BaseSetLastNTError(Status);
175  return 0;
176  }
177 
178  return ProcessDeviceMapInfo.Query.DriveMap;
179 }
180 
181 /*
182  * @implemented
183  */
184 BOOL
185 WINAPI
186 GetDiskFreeSpaceA(IN LPCSTR lpRootPathName,
187  OUT LPDWORD lpSectorsPerCluster,
188  OUT LPDWORD lpBytesPerSector,
189  OUT LPDWORD lpNumberOfFreeClusters,
190  OUT LPDWORD lpTotalNumberOfClusters)
191 {
192  PWCHAR RootPathNameW=NULL;
193 
194  if (lpRootPathName)
195  {
196  if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE)))
197  return FALSE;
198  }
199 
200  return GetDiskFreeSpaceW (RootPathNameW,
201  lpSectorsPerCluster,
202  lpBytesPerSector,
203  lpNumberOfFreeClusters,
204  lpTotalNumberOfClusters);
205 }
206 
207 /*
208  * @implemented
209  */
210 BOOL
211 WINAPI
212 GetDiskFreeSpaceW(IN LPCWSTR lpRootPathName,
213  OUT LPDWORD lpSectorsPerCluster,
214  OUT LPDWORD lpBytesPerSector,
215  OUT LPDWORD lpNumberOfFreeClusters,
216  OUT LPDWORD lpTotalNumberOfClusters)
217 {
218  FILE_FS_SIZE_INFORMATION FileFsSize;
220  WCHAR RootPathName[MAX_PATH];
221  HANDLE hFile;
222  NTSTATUS errCode;
223 
224  if (lpRootPathName)
225  {
226  wcsncpy (RootPathName, lpRootPathName, 3);
227  }
228  else
229  {
230  GetCurrentDirectoryW (MAX_PATH, RootPathName);
231  }
232  RootPathName[3] = 0;
233 
234  hFile = InternalOpenDirW(RootPathName, FALSE);
235  if (INVALID_HANDLE_VALUE == hFile)
236  {
238  return FALSE;
239  }
240 
241  errCode = NtQueryVolumeInformationFile(hFile,
242  &IoStatusBlock,
243  &FileFsSize,
244  sizeof(FILE_FS_SIZE_INFORMATION),
246  if (!NT_SUCCESS(errCode))
247  {
248  CloseHandle(hFile);
249  BaseSetLastNTError (errCode);
250  return FALSE;
251  }
252 
253  if (lpSectorsPerCluster)
254  *lpSectorsPerCluster = FileFsSize.SectorsPerAllocationUnit;
255  if (lpBytesPerSector)
256  *lpBytesPerSector = FileFsSize.BytesPerSector;
257  if (lpNumberOfFreeClusters)
258  *lpNumberOfFreeClusters = FileFsSize.AvailableAllocationUnits.u.LowPart;
259  if (lpTotalNumberOfClusters)
260  *lpTotalNumberOfClusters = FileFsSize.TotalAllocationUnits.u.LowPart;
261  CloseHandle(hFile);
262 
263  return TRUE;
264 }
265 
266 /*
267  * @implemented
268  */
269 BOOL
270 WINAPI
272  OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller,
273  OUT PULARGE_INTEGER lpTotalNumberOfBytes,
274  OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
275 {
276  PWCHAR DirectoryNameW=NULL;
277 
278  if (lpDirectoryName)
279  {
280  if (!(DirectoryNameW = FilenameA2W(lpDirectoryName, FALSE)))
281  return FALSE;
282  }
283 
284  return GetDiskFreeSpaceExW (DirectoryNameW ,
285  lpFreeBytesAvailableToCaller,
286  lpTotalNumberOfBytes,
287  lpTotalNumberOfFreeBytes);
288 }
289 
290 /*
291  * @implemented
292  */
293 BOOL
294 WINAPI
296  OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller,
297  OUT PULARGE_INTEGER lpTotalNumberOfBytes,
298  OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
299 {
300  union
301  {
304  } FsInfo;
306  ULARGE_INTEGER BytesPerCluster;
307  HANDLE hFile;
309 
310  if (lpDirectoryName == NULL)
311  lpDirectoryName = L"\\";
312 
313  hFile = InternalOpenDirW(lpDirectoryName, FALSE);
314  if (INVALID_HANDLE_VALUE == hFile)
315  {
316  return FALSE;
317  }
318 
319  if (lpFreeBytesAvailableToCaller != NULL || lpTotalNumberOfBytes != NULL)
320  {
321  /* To get the free space available to the user associated with the
322  current thread, try FileFsFullSizeInformation. If this is not
323  supported by the file system, fall back to FileFsSize */
324 
325  Status = NtQueryVolumeInformationFile(hFile,
326  &IoStatusBlock,
327  &FsInfo.FsFullSize,
328  sizeof(FsInfo.FsFullSize),
330 
331  if (NT_SUCCESS(Status))
332  {
333  /* Close the handle before returning data
334  to avoid a handle leak in case of a fault! */
335  CloseHandle(hFile);
336 
337  BytesPerCluster.QuadPart =
338  FsInfo.FsFullSize.BytesPerSector * FsInfo.FsFullSize.SectorsPerAllocationUnit;
339 
340  if (lpFreeBytesAvailableToCaller != NULL)
341  {
342  lpFreeBytesAvailableToCaller->QuadPart =
343  BytesPerCluster.QuadPart * FsInfo.FsFullSize.CallerAvailableAllocationUnits.QuadPart;
344  }
345 
346  if (lpTotalNumberOfBytes != NULL)
347  {
348  lpTotalNumberOfBytes->QuadPart =
349  BytesPerCluster.QuadPart * FsInfo.FsFullSize.TotalAllocationUnits.QuadPart;
350  }
351 
352  if (lpTotalNumberOfFreeBytes != NULL)
353  {
354  lpTotalNumberOfFreeBytes->QuadPart =
355  BytesPerCluster.QuadPart * FsInfo.FsFullSize.ActualAvailableAllocationUnits.QuadPart;
356  }
357 
358  return TRUE;
359  }
360  }
361 
362  Status = NtQueryVolumeInformationFile(hFile,
363  &IoStatusBlock,
364  &FsInfo.FsSize,
365  sizeof(FsInfo.FsSize),
367 
368  /* Close the handle before returning data
369  to avoid a handle leak in case of a fault! */
370  CloseHandle(hFile);
371 
372  if (!NT_SUCCESS(Status))
373  {
374  BaseSetLastNTError (Status);
375  return FALSE;
376  }
377 
378  BytesPerCluster.QuadPart =
379  FsInfo.FsSize.BytesPerSector * FsInfo.FsSize.SectorsPerAllocationUnit;
380 
381  if (lpFreeBytesAvailableToCaller)
382  {
383  lpFreeBytesAvailableToCaller->QuadPart =
384  BytesPerCluster.QuadPart * FsInfo.FsSize.AvailableAllocationUnits.QuadPart;
385  }
386 
387  if (lpTotalNumberOfBytes)
388  {
389  lpTotalNumberOfBytes->QuadPart =
390  BytesPerCluster.QuadPart * FsInfo.FsSize.TotalAllocationUnits.QuadPart;
391  }
392 
393  if (lpTotalNumberOfFreeBytes)
394  {
395  lpTotalNumberOfFreeBytes->QuadPart =
396  BytesPerCluster.QuadPart * FsInfo.FsSize.AvailableAllocationUnits.QuadPart;
397  }
398 
399  return TRUE;
400 }
401 
402 /*
403  * @implemented
404  */
405 UINT
406 WINAPI
407 GetDriveTypeA(IN LPCSTR lpRootPathName)
408 {
409  PWCHAR RootPathNameW;
410 
411  if (!lpRootPathName)
412  return GetDriveTypeW(NULL);
413 
414  if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE)))
415  return DRIVE_UNKNOWN;
416 
417  return GetDriveTypeW(RootPathNameW);
418 }
419 
420 /*
421  * @implemented
422  */
423 UINT
424 WINAPI
425 GetDriveTypeW(IN LPCWSTR lpRootPathName)
426 {
427  FILE_FS_DEVICE_INFORMATION FileFsDevice;
430  UNICODE_STRING PathName;
433  PWSTR CurrentDir = NULL;
434  PCWSTR lpRootPath;
435 
436  if (!lpRootPathName)
437  {
438  /* If NULL is passed, use current directory path */
440  CurrentDir = HeapAlloc(GetProcessHeap(), 0, BufferSize * sizeof(WCHAR));
441  if (!CurrentDir)
442  return DRIVE_UNKNOWN;
443  if (!GetCurrentDirectoryW(BufferSize, CurrentDir))
444  {
445  HeapFree(GetProcessHeap(), 0, CurrentDir);
446  return DRIVE_UNKNOWN;
447  }
448 
449  if (wcslen(CurrentDir) > 3)
450  CurrentDir[3] = 0;
451 
452  lpRootPath = CurrentDir;
453  }
454  else
455  {
456  size_t Length = wcslen(lpRootPathName);
457 
458  TRACE("lpRootPathName: %S\n", lpRootPathName);
459 
460  lpRootPath = lpRootPathName;
461  if (Length == 2)
462  {
463  WCHAR DriveLetter = RtlUpcaseUnicodeChar(lpRootPathName[0]);
464 
465  if (DriveLetter >= L'A' && DriveLetter <= L'Z' && lpRootPathName[1] == L':')
466  {
467  Length = (Length + 2) * sizeof(WCHAR);
468 
469  CurrentDir = HeapAlloc(GetProcessHeap(), 0, Length);
470  if (!CurrentDir)
471  return DRIVE_UNKNOWN;
472 
473  StringCbPrintfW(CurrentDir, Length, L"%s\\", lpRootPathName);
474 
475  lpRootPath = CurrentDir;
476  }
477  }
478  }
479 
480  TRACE("lpRootPath: %S\n", lpRootPath);
481 
482  if (!RtlDosPathNameToNtPathName_U(lpRootPath, &PathName, NULL, NULL))
483  {
484  if (CurrentDir != NULL)
485  HeapFree(GetProcessHeap(), 0, CurrentDir);
486 
487  return DRIVE_NO_ROOT_DIR;
488  }
489 
490  TRACE("PathName: %S\n", PathName.Buffer);
491 
492  if (CurrentDir != NULL)
493  HeapFree(GetProcessHeap(), 0, CurrentDir);
494 
495  if (PathName.Buffer[(PathName.Length >> 1) - 1] != L'\\')
496  {
497  return DRIVE_NO_ROOT_DIR;
498  }
499 
500  InitializeObjectAttributes(&ObjectAttributes,
501  &PathName,
503  NULL,
504  NULL);
505 
506  Status = NtOpenFile(&FileHandle,
508  &ObjectAttributes,
509  &IoStatusBlock,
512 
513  RtlFreeHeap(RtlGetProcessHeap(), 0, PathName.Buffer);
514  if (!NT_SUCCESS(Status))
515  return DRIVE_NO_ROOT_DIR; /* According to WINE regression tests */
516 
517  Status = NtQueryVolumeInformationFile(FileHandle,
518  &IoStatusBlock,
519  &FileFsDevice,
522  NtClose(FileHandle);
523  if (!NT_SUCCESS(Status))
524  {
525  return 0;
526  }
527 
528  switch (FileFsDevice.DeviceType)
529  {
530  case FILE_DEVICE_CD_ROM:
532  return DRIVE_CDROM;
534  return DRIVE_RAMDISK;
536  return DRIVE_REMOTE;
537  case FILE_DEVICE_DISK:
539  if (FileFsDevice.Characteristics & FILE_REMOTE_DEVICE)
540  return DRIVE_REMOTE;
541  if (FileFsDevice.Characteristics & FILE_REMOVABLE_MEDIA)
542  return DRIVE_REMOVABLE;
543  return DRIVE_FIXED;
544  }
545 
546  ERR("Returning DRIVE_UNKNOWN for device type %lu\n", FileFsDevice.DeviceType);
547 
548  return DRIVE_UNKNOWN;
549 }
550 
551 /* EOF */
#define FILE_GENERIC_READ
Definition: nt_native.h:653
DEBUG_CHANNEL(kernel32file)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
LARGE_INTEGER TotalAllocationUnits
Definition: from_kernel.h:263
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
#define FILE_DEVICE_DISK
Definition: winioctl.h:112
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
Definition: disk.c:407
Definition: bidi.c:75
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WARN(fmt,...)
Definition: debug.h:111
#define FileFsFullSizeInformation
Definition: ntifs_ex.h:389
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
#define DRIVE_RAMDISK
Definition: winbase.h:250
NTSTATUS NTAPI NtQueryInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength OPTIONAL)
Definition: query.c:56
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:413
PVOID *typedef PWSTR
Definition: winlogon.h:57
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define FILE_DEVICE_VIRTUAL_DISK
Definition: winioctl.h:141
uint16_t * PWCHAR
Definition: typedefs.h:54
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
*nSize LPSTR lpBuffer
Definition: winbase.h:1973
char * LPSTR
Definition: xmlstorage.h:182
static BOOL Write(PBYTE Address, PBYTE Data, SIZE_T Size)
Definition: vmhorizon.c:15
#define WCHAR
Definition: msvc.h:43
NTSYSAPI WCHAR NTAPI RtlUpcaseUnicodeChar(WCHAR Source)
DWORD DWORD
Definition: winlogon.h:75
#define FILE_SHARE_READ
Definition: compat.h:125
#define DRIVE_REMOVABLE
Definition: winbase.h:246
struct _LARGE_INTEGER::@2037 u
#define FILE_DEVICE_CD_ROM
Definition: winioctl.h:107
static char drive[2]
Definition: batch.c:28
#define DRIVE_REMOTE
Definition: winbase.h:248
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define FALSE
Definition: types.h:117
#define kernel32file
Definition: kernel32.h:6
#define FILE_REMOVABLE_MEDIA
Definition: nt_native.h:807
UINTN * BufferSize
Definition: acefiex.h:370
LARGE_INTEGER AvailableAllocationUnits
Definition: from_kernel.h:264
smooth NULL
Definition: ftsmooth.c:557
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
NTSTATUS NTAPI NtQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
Definition: iofunc.c:3813
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
const char * LPCSTR
Definition: xmlstorage.h:183
#define DRIVE_UNKNOWN
Definition: winbase.h:251
_In_ LPCSTR _In_opt_ LPCSTR _In_ DWORD nBufferLength
Definition: winbase.h:2959
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:113
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc)
Definition: fileinfo.c:22
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3508
BOOL WINAPI GetDiskFreeSpaceW(IN LPCWSTR lpRootPathName, OUT LPDWORD lpSectorsPerCluster, OUT LPDWORD lpBytesPerSector, OUT LPDWORD lpNumberOfFreeClusters, OUT LPDWORD lpTotalNumberOfClusters)
Definition: disk.c:212
unsigned char BOOLEAN
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define MAX_PATH
Definition: compat.h:26
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define SetLastError(x)
Definition: compat.h:409
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3392
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID UINTN Length
Definition: acefiex.h:744
#define FILE_REMOTE_DEVICE
Definition: nt_native.h:811
#define SYNCHRONIZE
Definition: nt_native.h:61
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:425
_In_ HANDLE hFile
Definition: mswsock.h:90
#define WINAPI
Definition: msvc.h:20
#define DRIVE_NO_ROOT_DIR
Definition: winbase.h:252
#define DRIVE_FIXED
Definition: winbase.h:247
Status
Definition: gdiplustypes.h:24
#define FILE_GENERIC_WRITE
Definition: nt_native.h:660
DWORD WINAPI GetLogicalDrives(VOID)
Definition: disk.c:159
#define FILE_OPEN
Definition: from_kernel.h:54
#define ERR(fmt,...)
Definition: debug.h:109
static HANDLE FileHandle
Definition: cabinet.c:47
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
struct _PROCESS_DEVICEMAP_INFORMATION::@3579::@3581 Query
#define DRIVE_CDROM
Definition: winbase.h:249
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
unsigned int UINT
Definition: ndis.h:50
#define FILE_DEVICE_NETWORK_FILE_SYSTEM
Definition: winioctl.h:125
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
BOOL WINAPI GetDiskFreeSpaceExA(IN LPCSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:271
#define OUT
Definition: typedefs.h:39
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:108
uint32_t * LPDWORD
Definition: typedefs.h:57
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
DWORD WINAPI GetLogicalDriveStringsA(IN DWORD nBufferLength, IN LPSTR lpBuffer)
Definition: disk.c:83
#define MAX_DOS_DRIVES
Definition: disk.c:28
BOOL WINAPI GetDiskFreeSpaceA(IN LPCSTR lpRootPathName, OUT LPDWORD lpSectorsPerCluster, OUT LPDWORD lpBytesPerSector, OUT LPDWORD lpNumberOfFreeClusters, OUT LPDWORD lpTotalNumberOfClusters)
Definition: disk.c:186
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_BAD_PATHNAME
Definition: winerror.h:233
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
IN HDEVINFO IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
Definition: devinst.c:44
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
HANDLE WINAPI InternalOpenDirW(IN LPCWSTR DirName, IN BOOLEAN Write)
Definition: disk.c:32
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:295
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:122