Bug 1456 : patch from w3seek : Fix a bug in CreateDirectoryEx that makes the function attempt to create the template directory again

svn path=/trunk/; revision=21835
This commit is contained in:
Magnus Olsen 2006-05-07 18:17:50 +00:00
parent bad04e557d
commit b8c0b29fc9

View file

@ -191,12 +191,6 @@ CreateDirectoryExW (
return FALSE;
}
InitializeObjectAttributes(&ObjectAttributes,
&NtPathU,
OBJ_CASE_INSENSITIVE,
NULL,
(lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL));
InitializeObjectAttributes(&ObjectAttributes,
&NtTemplatePathU,
OBJ_CASE_INSENSITIVE,
@ -256,7 +250,13 @@ OpenTemplateDir:
Status = STATUS_OBJECT_NAME_INVALID;
goto Cleanup;
}
InitializeObjectAttributes(&ObjectAttributes,
&NtPathU,
OBJ_CASE_INSENSITIVE,
NULL,
(lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL));
/*
* Query the basic file attributes from the template directory
*/
@ -358,6 +358,7 @@ OpenTemplateDir:
/*
* Create the new directory
*/
Status = NtCreateFile (&DirectoryHandle,
DesiredAccess,
&ObjectAttributes,
@ -443,7 +444,7 @@ OpenTemplateDir:
/* FIXME - enumerate and copy the file streams */
}
/*
* We successfully created the directory and copied all information
* from the template directory
@ -460,7 +461,7 @@ CleanupNoNtPath:
{
NtClose(TemplateHandle);
}
RtlFreeHeap (RtlGetProcessHeap (),
0,
NtTemplatePathU.Buffer);