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

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

* empty log message *

File size: 5.2 KB
Line 
1/*
2 * Win32 Disk API 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//******************************************************************************
16BOOL WIN32API SetVolumeLabelA( LPCSTR arg1, LPCSTR arg2)
17{
18 dprintf(("KERNEL32: OS2SetVolumeLabelA\n"));
19 return O32_SetVolumeLabel(arg1, arg2);
20}
21//******************************************************************************
22//******************************************************************************
23BOOL WIN32API SetVolumeLabelW(LPWSTR lpRootPathName, LPWSTR lpVolumeName)
24{
25 char *asciiroot, *asciivolname;
26 BOOL rc;
27
28 dprintf(("KERNEL32: OS2SetVolumeLabelW\n"));
29 asciiroot = UnicodeToAsciiString(lpRootPathName);
30 asciivolname = UnicodeToAsciiString(lpVolumeName);
31 rc = O32_SetVolumeLabel(asciiroot, asciivolname);
32 FreeAsciiString(asciivolname);
33 FreeAsciiString(asciiroot);
34 return(rc);
35}
36
37//******************************************************************************
38//SvL: 24-6-'97 - Added
39//******************************************************************************
40BOOL WIN32API GetDiskFreeSpaceA( LPCSTR arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5)
41{
42 dprintf(("KERNEL32: OS2GetDiskFreeSpaceA\n"));
43 return O32_GetDiskFreeSpace(arg1, arg2, arg3, arg4, arg5);
44}
45//******************************************************************************
46//******************************************************************************
47BOOL WIN32API GetDiskFreeSpaceW(LPCWSTR arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5)
48{
49 BOOL rc;
50 char *astring;
51
52 dprintf(("KERNEL32: OS2GetDiskFreeSpaceW\n"));
53 astring = UnicodeToAsciiString((LPWSTR)arg1);
54 rc = O32_GetDiskFreeSpace(astring, arg2, arg3, arg4, arg5);
55 FreeAsciiString(astring);
56 return(rc);
57}
58//******************************************************************************
59//******************************************************************************
60UINT WIN32API GetDriveTypeA( LPCSTR arg1)
61{
62 dprintf(("KERNEL32: GetDriveType %s\n", arg1));
63 return O32_GetDriveType(arg1);
64}
65//******************************************************************************
66//******************************************************************************
67UINT WIN32API GetDriveTypeW(LPCWSTR arg1)
68{
69 UINT rc;
70 char *astring;
71
72 dprintf(("KERNEL32: OS2GetDriveTypeW\n"));
73 astring = UnicodeToAsciiString((LPWSTR)arg1);
74 rc = O32_GetDriveType(astring);
75 FreeAsciiString(astring);
76 return(rc);
77}
78//******************************************************************************
79//******************************************************************************
80BOOL WIN32API GetVolumeInformationA(LPCSTR arg1, LPSTR arg2, DWORD arg3, PDWORD arg4,
81 PDWORD arg5, PDWORD arg6, LPSTR arg7, DWORD arg8)
82{
83 dprintf(("KERNEL32: GetVolumeInformation %s %s\n", arg1, arg2));
84 return O32_GetVolumeInformation(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
85}
86//******************************************************************************
87//******************************************************************************
88BOOL WIN32API GetVolumeInformationW(LPCWSTR arg1, LPWSTR arg2, DWORD arg3,
89 PDWORD arg4, PDWORD arg5, PDWORD arg6,
90 LPWSTR arg7, DWORD arg8)
91{
92 char *asciiroot, *asciivol, *asciifs;
93 BOOL rc;
94
95 dprintf(("KERNEL32: OS2GetVolumeInformationW\n"));
96 asciivol = (char *)malloc(arg3+1);
97 asciifs = (char *)malloc(arg8+1);
98 asciiroot = UnicodeToAsciiString((LPWSTR)arg1);
99 rc = O32_GetVolumeInformation(asciiroot, asciivol, arg3, arg4, arg5, arg6, asciifs, arg8);
100
101 if (arg2 != NULL) /* @@@PH 98/06/07 */
102 AsciiToUnicode(asciivol, arg2);
103
104 if (arg7 != NULL) /* @@@PH 98/06/07 */
105 AsciiToUnicode(asciifs, arg7);
106
107 FreeAsciiString(asciiroot);
108 free(asciifs);
109 free(asciivol);
110 return(rc);
111}
112//******************************************************************************
113//******************************************************************************
114DWORD WIN32API GetLogicalDrives(void)
115{
116 dprintf(("KERNEL32: GetLogicalDrives\n"));
117 return O32_GetLogicalDrives();
118}
119//******************************************************************************
120//******************************************************************************
121UINT WIN32API GetLogicalDriveStringsA(UINT arg1, LPSTR arg2)
122{
123 dprintf(("KERNEL32: OS2GetLogicalDriveStringsA\n"));
124 return O32_GetLogicalDriveStrings(arg1, arg2);
125}
126//******************************************************************************
127//******************************************************************************
128UINT WIN32API GetLogicalDriveStringsW(UINT nBufferLength, LPWSTR lpBuffer)
129{
130 char *asciibuffer = (char *)malloc(nBufferLength+1);
131 DWORD rc;
132
133 dprintf(("KERNEL32: OS2GetLogicalDriveStringsW\n"));
134
135 rc = O32_GetLogicalDriveStrings(nBufferLength, asciibuffer);
136 if(rc) AsciiToUnicode(asciibuffer, lpBuffer);
137 free(asciibuffer);
138 return(rc);
139}
Note: See TracBrowser for help on using the repository browser.