mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Some more fixes.
svn path=/trunk/; revision=432
This commit is contained in:
parent
14e5e06271
commit
0064915ad7
2 changed files with 95 additions and 50 deletions
|
@ -37,6 +37,12 @@ WINBOOL STDCALL CreateDirectoryExA(LPCSTR lpTemplateDirectory,
|
|||
WCHAR TemplateDirectoryW[MAX_PATH];
|
||||
WCHAR NewDirectoryW[MAX_PATH];
|
||||
ULONG i;
|
||||
|
||||
DPRINT("lpTemplateDirectory %s lpNewDirectory %s lpSecurityAttributes %p\n",
|
||||
lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes);
|
||||
|
||||
if (lpTemplateDirectory)
|
||||
{
|
||||
i = 0;
|
||||
while ((*lpTemplateDirectory)!=0 && i < MAX_PATH)
|
||||
{
|
||||
|
@ -45,7 +51,11 @@ WINBOOL STDCALL CreateDirectoryExA(LPCSTR lpTemplateDirectory,
|
|||
i++;
|
||||
}
|
||||
TemplateDirectoryW[i] = 0;
|
||||
}
|
||||
DPRINT ("\n");
|
||||
|
||||
if (lpNewDirectory)
|
||||
{
|
||||
i = 0;
|
||||
while ((*lpNewDirectory)!=0 && i < MAX_PATH)
|
||||
{
|
||||
|
@ -54,8 +64,11 @@ WINBOOL STDCALL CreateDirectoryExA(LPCSTR lpTemplateDirectory,
|
|||
i++;
|
||||
}
|
||||
NewDirectoryW[i] = 0;
|
||||
return CreateDirectoryExW(TemplateDirectoryW,
|
||||
NewDirectoryW,
|
||||
}
|
||||
DPRINT ("\n");
|
||||
|
||||
return CreateDirectoryExW(lpTemplateDirectory?TemplateDirectoryW:NULL,
|
||||
lpNewDirectory?NewDirectoryW:NULL,
|
||||
lpSecurityAttributes);
|
||||
}
|
||||
|
||||
|
@ -63,7 +76,6 @@ WINBOOL STDCALL CreateDirectoryExA(LPCSTR lpTemplateDirectory,
|
|||
WINBOOL STDCALL CreateDirectoryW(LPCWSTR lpPathName,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes)
|
||||
{
|
||||
|
||||
return CreateDirectoryExW(NULL,lpPathName,lpSecurityAttributes);
|
||||
}
|
||||
|
||||
|
@ -77,7 +89,10 @@ WINBOOL STDCALL CreateDirectoryExW(LPCWSTR lpTemplateDirectory,
|
|||
UNICODE_STRING DirectoryNameString;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
|
||||
if ( lpTemplateDirectory != NULL )
|
||||
DPRINT("lpTemplateDirectory %w lpNewDirectory %w lpSecurityAttributes %p\n",
|
||||
lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes);
|
||||
|
||||
if ( lpTemplateDirectory != NULL && *lpTemplateDirectory != 0 )
|
||||
{
|
||||
// get object attributes from template directory
|
||||
DPRINT("KERNEL32:FIXME:%s:%d\n",__FILE__,__LINE__);
|
||||
|
@ -106,7 +121,7 @@ WINBOOL STDCALL CreateDirectoryExW(LPCWSTR lpTemplateDirectory,
|
|||
0,
|
||||
NULL,
|
||||
0);
|
||||
|
||||
DPRINT("errCode: %x\n", errCode);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
|
|
|
@ -128,9 +128,11 @@ GetDiskFreeSpaceA(
|
|||
LPDWORD lpTotalNumberOfClusters
|
||||
)
|
||||
{
|
||||
ULONG i;
|
||||
WCHAR RootPathNameW[MAX_PATH];
|
||||
i = 0;
|
||||
|
||||
if (lpRootPathName)
|
||||
{
|
||||
ULONG i = 0;
|
||||
while ((*lpRootPathName)!=0 && i < MAX_PATH)
|
||||
{
|
||||
RootPathNameW[i] = *lpRootPathName;
|
||||
|
@ -138,7 +140,13 @@ GetDiskFreeSpaceA(
|
|||
i++;
|
||||
}
|
||||
RootPathNameW[i] = 0;
|
||||
return GetDiskFreeSpaceW(RootPathNameW,lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters );
|
||||
}
|
||||
|
||||
return GetDiskFreeSpaceW(lpRootPathName?RootPathNameW:NULL,
|
||||
lpSectorsPerCluster,
|
||||
lpBytesPerSector,
|
||||
lpNumberOfFreeClusters,
|
||||
lpTotalNumberOfClusters);
|
||||
}
|
||||
|
||||
WINBOOL
|
||||
|
@ -153,10 +161,21 @@ GetDiskFreeSpaceW(
|
|||
{
|
||||
FILE_FS_SIZE_INFORMATION FileFsSize;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
WCHAR RootPathName[MAX_PATH];
|
||||
HANDLE hFile;
|
||||
NTSTATUS errCode;
|
||||
|
||||
hFile = CreateFileW(lpRootPathName,
|
||||
if (lpRootPathName)
|
||||
{
|
||||
wcsncpy (RootPathName, lpRootPathName, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetCurrentDirectoryW (MAX_PATH, RootPathName);
|
||||
RootPathName[3] = 0;
|
||||
}
|
||||
|
||||
hFile = CreateFileW(RootPathName,
|
||||
FILE_READ_ATTRIBUTES,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
|
@ -194,9 +213,10 @@ GetDiskFreeSpaceExA(
|
|||
)
|
||||
{
|
||||
WCHAR DirectoryNameW[MAX_PATH];
|
||||
ULONG i;
|
||||
|
||||
i = 0;
|
||||
if (lpDirectoryName)
|
||||
{
|
||||
ULONG i = 0;
|
||||
while ((*lpDirectoryName)!=0 && i < MAX_PATH)
|
||||
{
|
||||
DirectoryNameW[i] = *lpDirectoryName;
|
||||
|
@ -204,7 +224,9 @@ GetDiskFreeSpaceExA(
|
|||
i++;
|
||||
}
|
||||
DirectoryNameW[i] = 0;
|
||||
return GetDiskFreeSpaceExW(DirectoryNameW,
|
||||
}
|
||||
|
||||
return GetDiskFreeSpaceExW(lpDirectoryName?DirectoryNameW:NULL,
|
||||
lpFreeBytesAvailableToCaller,
|
||||
lpTotalNumberOfBytes,
|
||||
lpTotalNumberOfFreeBytes);
|
||||
|
@ -222,14 +244,22 @@ GetDiskFreeSpaceExW(
|
|||
{
|
||||
FILE_FS_SIZE_INFORMATION FileFsSize;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
ULARGE_INTEGER BytesPerCluster;
|
||||
WCHAR RootPathName[MAX_PATH];
|
||||
HANDLE hFile;
|
||||
NTSTATUS errCode;
|
||||
WCHAR RootPath[4];
|
||||
ULARGE_INTEGER BytesPerCluster;
|
||||
|
||||
wcsncpy (RootPath, lpDirectoryName, 3);
|
||||
if (lpDirectoryName)
|
||||
{
|
||||
wcsncpy (RootPathName, lpDirectoryName, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetCurrentDirectoryW (MAX_PATH, RootPathName);
|
||||
RootPathName[3] = 0;
|
||||
}
|
||||
|
||||
hFile = CreateFileW(RootPath,
|
||||
hFile = CreateFileW(RootPathName,
|
||||
FILE_READ_ATTRIBUTES,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue