changes to make create directory functions active.

svn path=/trunk/; revision=167
This commit is contained in:
jean 1999-01-13 15:57:45 +00:00
parent dd705acbd0
commit 6298d37c71

View file

@ -37,13 +37,16 @@ CreateDirectoryExA(
WCHAR NewDirectoryW[MAX_PATH]; WCHAR NewDirectoryW[MAX_PATH];
ULONG i; ULONG i;
i = 0; i = 0;
while ((*lpTemplateDirectory)!=0 && i < MAX_PATH) if(lpTemplateDirectory)
{
while ((*lpTemplateDirectory)!=0 && i < MAX_PATH)
{ {
TemplateDirectoryW[i] = *lpTemplateDirectory; TemplateDirectoryW[i] = *lpTemplateDirectory;
lpTemplateDirectory++; lpTemplateDirectory++;
i++; i++;
} }
TemplateDirectoryW[i] = 0; TemplateDirectoryW[i] = 0;
}
i = 0; i = 0;
while ((*lpNewDirectory)!=0 && i < MAX_PATH) while ((*lpNewDirectory)!=0 && i < MAX_PATH)
@ -80,14 +83,27 @@ CreateDirectoryExW(
HANDLE DirectoryHandle; HANDLE DirectoryHandle;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DirectoryNameString; UNICODE_STRING DirectoryNameString;
WCHAR PathNameW[MAX_PATH],CurrentDir[MAX_PATH];
if ( lpTemplateDirectory != NULL ) { if ( lpTemplateDirectory != NULL ) {
// get object attributes from template directory // get object attributes from template directory
} }
PathNameW[0] = '\\';
PathNameW[1] = '?';
PathNameW[2] = '?';
PathNameW[3] = '\\';
PathNameW[4] = 0;
if (lpNewDirectory[0] != L'\\' && lpNewDirectory[1] != L':')
{
GetCurrentDirectoryW(MAX_PATH,CurrentDir);
lstrcatW(PathNameW,CurrentDir);
}
lstrcatW(PathNameW,lpNewDirectory);
DirectoryNameString.Length = lstrlenW(lpNewDirectory)*sizeof(WCHAR); DirectoryNameString.Length = lstrlenW(PathNameW)*sizeof(WCHAR);
DirectoryNameString.Buffer = (WCHAR *)lpNewDirectory; DirectoryNameString.Buffer = (WCHAR *)PathNameW;
DirectoryNameString.MaximumLength = DirectoryNameString.Length; DirectoryNameString.MaximumLength = DirectoryNameString.Length;
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES); ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
@ -98,11 +114,17 @@ CreateDirectoryExW(
ObjectAttributes.SecurityQualityOfService = NULL; ObjectAttributes.SecurityQualityOfService = NULL;
errCode = NtCreateDirectoryObject( errCode = NtCreateFile(&DirectoryHandle,
&DirectoryHandle, FILE_LIST_DIRECTORY,
GENERIC_ALL, &ObjectAttributes,
&ObjectAttributes NULL,
); NULL,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_CREATE,
FILE_DIRECTORY_FILE,
NULL,
0);
if (!NT_SUCCESS(errCode) ) { if (!NT_SUCCESS(errCode) ) {
SetLastError(RtlNtStatusToDosError(errCode)); SetLastError(RtlNtStatusToDosError(errCode));
return FALSE; return FALSE;
@ -393,4 +415,4 @@ SearchPathW(
return lstrlenW(lpBuffer); return lstrlenW(lpBuffer);
} }