revert changes from CreateFileA
Modified: trunk/reactos/lib/kernel32/file/create.c

Modified: trunk/reactos/lib/kernel32/file/create.c
--- trunk/reactos/lib/kernel32/file/create.c	2005-03-20 20:43:46 UTC (rev 14235)
+++ trunk/reactos/lib/kernel32/file/create.c	2005-03-20 20:46:16 UTC (rev 14236)
@@ -34,26 +34,15 @@
 			    DWORD			dwFlagsAndAttributes,
 			    HANDLE			hTemplateFile)
 {
-   UNICODE_STRING FileNameU;
-   ANSI_STRING FileName;
+   PWCHAR FileNameW;
    HANDLE FileHandle;
    
    DPRINT("CreateFileA(lpFileName %s)\n",lpFileName);
    
-   RtlInitAnsiString (&FileName,
-		      (LPSTR)lpFileName);
-   
-   /* convert ansi (or oem) string to unicode */
-   if (bIsFileApiAnsi)
-     RtlAnsiStringToUnicodeString (&FileNameU,
-				   &FileName,
-				   TRUE);
-   else
-     RtlOemStringToUnicodeString (&FileNameU,
-				  &FileName,
-				  TRUE);
+   if (!(FileNameW = FilenameA2W(lpFileName, FALSE)))
+      return INVALID_HANDLE_VALUE;
 
-   FileHandle = CreateFileW (FileNameU.Buffer,
+   FileHandle = CreateFileW (FileNameW,
 			     dwDesiredAccess,
 			     dwShareMode,
 			     lpSecurityAttributes,
@@ -61,10 +50,6 @@
 			     dwFlagsAndAttributes,
 			     hTemplateFile);
    
-   RtlFreeHeap (RtlGetProcessHeap (),
-		0,
-		FileNameU.Buffer);
-   
    return FileHandle;
 }