CreateDirectoryA handled WINCE_NSPRPUB_RELEASE_4_2_BETA1
authorblythe%netscape.com
Fri, 08 Feb 2002 22:25:05 +0000
branchWINCE_NSPRPUB_RELEASE_4_2_BETA1
changeset 2233 e460563a458a0817d325385743702fcebcea3707
parent 2232 957a5e9c89dc0e635f78e002df73580b101aec8b
child 2234 476190c9af4c4de79717b557ccc67000e061a1d6
push idunknown
push userunknown
push dateunknown
CreateDirectoryA handled
pr/include/md/_win32_unicode.h
pr/src/md/windows/w32unicode.c
pr/src/md/windows/w95io.c
--- a/pr/include/md/_win32_unicode.h
+++ b/pr/include/md/_win32_unicode.h
@@ -95,11 +95,18 @@ WINAPI
     );
 
 DWORD
 WINAPI
 _MD_GetFileAttributesA(
     LPCSTR lpFileName
     );
 
+BOOL
+WINAPI
+_MD_CreateDirectoryA(
+    LPCSTR lpPathName,
+    LPSECURITY_ATTRIBUTES lpSecurityAttributes
+    );
+
 #endif /* WINCE */
 
 #endif /* nspr_win32_unicode_h___ */
--- a/pr/src/md/windows/w32unicode.c
+++ b/pr/src/md/windows/w32unicode.c
@@ -349,9 +349,36 @@ WINAPI
     else
     {
         PR_SetError(PR_NAME_TOO_LONG_ERROR, 0);
     }
 
     return retval;
 }
 
+BOOL
+WINAPI
+_MD_CreateDirectoryA(
+    LPCSTR lpPathName,
+    LPSECURITY_ATTRIBUTES lpSecurityAttributes
+    )
+{
+    BOOL retval = FALSE;
+    LPWSTR wideStr = NULL;
+    WCHAR widePath[MAX_PATH + 1];
+
+    wideStr = _PR_MD_A2W(lpPathName, widePath, sizeof(widePath) / sizeof(WCHAR));
+    if(NULL != wideStr)
+    {
+        retval = CreateDirectoryW(
+            wideStr,
+            lpSecurityAttributes
+            );
+    }
+    else
+    {
+        PR_SetError(PR_NAME_TOO_LONG_ERROR, 0);
+    }
+
+    return retval;
+}
+
 #endif /* WINCE */
\ No newline at end of file
--- a/pr/src/md/windows/w95io.c
+++ b/pr/src/md/windows/w95io.c
@@ -1231,17 +1231,17 @@ PRInt32
 PRInt32
 _PR_MD_MKDIR(const char *name, PRIntn mode)
 {
     /* XXXMB - how to translate the "mode"??? */
     if (
 #if !defined(WINCE)
         CreateDirectory(name, NULL)
 #else
-        CreateDirectoryA(name, NULL)
+        _MD_CreateDirectoryA(name, NULL)
 #endif
         ) {
         return 0;
     } else {
 		_PR_MD_MAP_MKDIR_ERROR(GetLastError());
         return -1;
     }
 }
@@ -1260,17 +1260,17 @@ PRInt32
         sa.nLength = sizeof(sa);
         sa.lpSecurityDescriptor = pSD;
         sa.bInheritHandle = FALSE;
         lpSA = &sa;
     }
 #if !defined(WINCE)
     rv = CreateDirectory(name, lpSA);
 #else
-    rv = CreateDirectoryA(name, lpSA);
+    rv = _MD_CreateDirectoryA(name, lpSA);
 #endif
     if (lpSA != NULL) {
         _PR_NT_FreeSecurityDescriptorACL(pSD, pACL);
     }
     if (rv) {
         return 0;
     } else {
         _PR_MD_MAP_MKDIR_ERROR(GetLastError());