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

Last change on this file since 17 was 17, checked in by phaller, 26 years ago

Code cleanup #1 for build, mainly addresses linkage problems

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