summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblythe%netscape.com <devnull@localhost>2002-02-08 22:25:05 +0000
committerblythe%netscape.com <devnull@localhost>2002-02-08 22:25:05 +0000
commit077810daf4422a300c54fdb8416abeceddb68b5a (patch)
tree3369ad6a6f23a0deb6fcd4dd6bc4132216ded6f6
parent25da0e1024dcbde0cf2fa68811f79dcce3c37031 (diff)
downloadnspr-hg-077810daf4422a300c54fdb8416abeceddb68b5a.tar.gz
CreateDirectoryA handled
-rw-r--r--pr/include/md/_win32_unicode.h7
-rw-r--r--pr/src/md/windows/w32unicode.c27
-rw-r--r--pr/src/md/windows/w95io.c4
3 files changed, 36 insertions, 2 deletions
diff --git a/pr/include/md/_win32_unicode.h b/pr/include/md/_win32_unicode.h
index 833f6952..60bc5706 100644
--- a/pr/include/md/_win32_unicode.h
+++ b/pr/include/md/_win32_unicode.h
@@ -100,6 +100,13 @@ _MD_GetFileAttributesA(
LPCSTR lpFileName
);
+BOOL
+WINAPI
+_MD_CreateDirectoryA(
+ LPCSTR lpPathName,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes
+ );
+
#endif /* WINCE */
#endif /* nspr_win32_unicode_h___ */
diff --git a/pr/src/md/windows/w32unicode.c b/pr/src/md/windows/w32unicode.c
index 158897bd..762a7a1e 100644
--- a/pr/src/md/windows/w32unicode.c
+++ b/pr/src/md/windows/w32unicode.c
@@ -354,4 +354,31 @@ _MD_GetFileAttributesA(
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
diff --git a/pr/src/md/windows/w95io.c b/pr/src/md/windows/w95io.c
index f3a13745..0e296cf3 100644
--- a/pr/src/md/windows/w95io.c
+++ b/pr/src/md/windows/w95io.c
@@ -1236,7 +1236,7 @@ _PR_MD_MKDIR(const char *name, PRIntn mode)
#if !defined(WINCE)
CreateDirectory(name, NULL)
#else
- CreateDirectoryA(name, NULL)
+ _MD_CreateDirectoryA(name, NULL)
#endif
) {
return 0;
@@ -1265,7 +1265,7 @@ _PR_MD_MAKE_DIR(const char *name, PRIntn mode)
#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);