source: trunk/src/kernel32/directory.cpp@ 46

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 4.9 KB
Line 
1/*
2 * Win32 Directory functions for OS/2
3 *
4 * Copyright 1998 Sander van Leeuwen
5 *
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10#include <os2win.h>
11#include <stdlib.h>
12#include "unicode.h"
13
14//******************************************************************************
15//******************************************************************************
16UINT WIN32API GetCurrentDirectoryA(UINT arg1, LPSTR arg2)
17{
18 dprintf(("KERNEL32: GetCurrentDirectory\n"));
19 return O32_GetCurrentDirectory(arg1, arg2);
20}
21//******************************************************************************
22//******************************************************************************
23UINT WIN32API GetCurrentDirectoryW(UINT nBufferLength, LPWSTR lpBuffer)
24{
25 char *asciidir = (char *)malloc(nBufferLength+1);
26 int rc;
27
28 dprintf(("KERNEL32: OS2GetCurrentDirectoryW\n"));
29
30 rc = O32_GetCurrentDirectory(nBufferLength, asciidir);
31 if(rc != 0) {
32 AsciiToUnicode(asciidir, lpBuffer);
33 }
34 free(asciidir);
35 return(rc);
36}
37//******************************************************************************
38
39//******************************************************************************
40BOOL WIN32API SetCurrentDirectoryA(LPCSTR arg1)
41{
42 dprintf(("KERNEL32: SetCurrentDirectory to %s\n", arg1));
43 return O32_SetCurrentDirectory((LPSTR)arg1);
44}
45//******************************************************************************
46//******************************************************************************
47BOOL WIN32API SetCurrentDirectoryW(LPCWSTR lpPathName)
48{
49 char *asciipath;
50 BOOL rc;
51
52 dprintf(("KERNEL32: OS2SetCurrentDirectoryW\n"));
53 asciipath = UnicodeToAsciiString((LPWSTR)lpPathName);
54 rc = O32_SetCurrentDirectory(asciipath);
55 FreeAsciiString(asciipath);
56 return(rc);
57}
58//******************************************************************************
59//******************************************************************************
60BOOL WIN32API CreateDirectoryA( LPCSTR arg1, PSECURITY_ATTRIBUTES arg2)
61{
62 dprintf(("KERNEL32: OS2CreateDirectoryA %s\n", arg1));
63 return O32_CreateDirectory(arg1, arg2);
64}
65//******************************************************************************
66//******************************************************************************
67BOOL WIN32API CreateDirectoryW(LPCWSTR arg1, PSECURITY_ATTRIBUTES arg2)
68{
69 BOOL rc;
70 char *astring;
71
72 dprintf(("KERNEL32: OS2CreateDirectoryW"));
73 astring = UnicodeToAsciiString((LPWSTR)arg1);
74 rc = O32_CreateDirectory(astring, arg2);
75 FreeAsciiString(astring);
76 return(rc);
77}
78//******************************************************************************
79//******************************************************************************
80UINT WIN32API GetSystemDirectoryA(LPSTR arg1, UINT arg2)
81{
82 dprintf(("KERNEL32: GetSystemDirectory\n"));
83 return O32_GetSystemDirectory(arg1, arg2);
84}
85//******************************************************************************
86//******************************************************************************
87UINT WIN32API GetSystemDirectoryW(LPWSTR lpBuffer, UINT uSize)
88{
89 char *asciibuffer = (char *)malloc(uSize+1);
90 UINT rc;
91
92 dprintf(("KERNEL32: OS2GetSystemDirectoryW\n"));
93 rc = O32_GetSystemDirectory(asciibuffer, uSize);
94 if(rc) AsciiToUnicode(asciibuffer, lpBuffer);
95 free(asciibuffer);
96 return(rc);
97}
98//******************************************************************************
99//******************************************************************************
100UINT WIN32API GetWindowsDirectoryA( LPSTR arg1, UINT arg2)
101{
102 dprintf(("KERNEL32: GetWindowsDirectory\n"));
103 return O32_GetWindowsDirectory(arg1, arg2);
104}
105//******************************************************************************
106//******************************************************************************
107UINT WIN32API GetWindowsDirectoryW(LPWSTR lpBuffer, UINT uSize)
108{
109 char *asciibuffer = (char *)malloc(uSize+1);
110 UINT rc;
111
112 dprintf(("KERNEL32: OS2GetWindowsDirectoryW"));
113 rc = O32_GetWindowsDirectory(asciibuffer, uSize);
114 AsciiToUnicode(asciibuffer, lpBuffer);
115 free(asciibuffer);
116 return(rc);
117}
118//******************************************************************************
119//******************************************************************************
120BOOL WIN32API RemoveDirectoryA( LPCSTR arg1)
121{
122 dprintf(("KERNEL32: OS2RemoveDirectoryA\n"));
123 return O32_RemoveDirectory(arg1);
124}
125//******************************************************************************
126//******************************************************************************
127BOOL WIN32API RemoveDirectoryW(LPCWSTR lpPathName)
128{
129 char *asciipath;
130 BOOL rc;
131
132 dprintf(("KERNEL32: OS2RemoveDirectoryW"));
133 asciipath = UnicodeToAsciiString((LPWSTR)lpPathName);
134 rc = O32_RemoveDirectory(asciipath);
135 FreeAsciiString(asciipath);
136 return(rc);
137}
Note: See TracBrowser for help on using the repository browser.