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

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

Add: added cvs variable $Id$ to the source files.

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