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

Last change on this file since 4 was 4, checked in by ktk, 26 years ago

Import

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