Changeset 1651 for trunk/src/kernel32/disk.cpp
- Timestamp:
- Nov 9, 1999, 2:22:32 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/disk.cpp
r682 r1651 1 /* $Id: disk.cpp,v 1. 5 1999-08-25 11:25:47 sandervlExp $ */1 /* $Id: disk.cpp,v 1.6 1999-11-09 01:22:32 phaller Exp $ */ 2 2 3 3 /* … … 10 10 * 11 11 */ 12 13 14 #include <odin.h> 15 #include <odinwrap.h> 16 #include <os2sel.h> 17 12 18 #include <os2win.h> 13 19 #include <stdlib.h> 20 #include <string.h> 14 21 #include "unicode.h" 22 23 24 ODINDEBUGCHANNEL(KERNEL32-DISK) 15 25 16 26 //****************************************************************************** … … 80 90 //****************************************************************************** 81 91 //****************************************************************************** 82 BOOL WIN32API GetVolumeInformationA(LPCSTR arg1, LPSTR arg2, DWORD arg3, PDWORD arg4, 83 PDWORD arg5, PDWORD arg6, LPSTR arg7, DWORD arg8) 92 ODINFUNCTION8(BOOL, GetVolumeInformationA, 93 LPCSTR, lpRootPathName, 94 LPSTR, lpVolumeNameBuffer, 95 DWORD, nVolumeNameSize, 96 PDWORD, lpVolumeSerialNumber, 97 PDWORD, lpMaximumComponentLength, 98 PDWORD, lpFileSystemFlags, 99 LPSTR, lpFileSystemNameBuffer, 100 DWORD, nFileSystemNameSize) 84 101 { 85 dprintf(("KERNEL32: GetVolumeInformation %s %s\n", arg1, arg2)); 86 return O32_GetVolumeInformation(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); 102 return O32_GetVolumeInformation(lpRootPathName, 103 lpVolumeNameBuffer, 104 nVolumeNameSize, 105 lpVolumeSerialNumber, 106 lpMaximumComponentLength, 107 lpFileSystemFlags, 108 lpFileSystemNameBuffer, 109 nFileSystemNameSize); 87 110 } 88 111 //****************************************************************************** 89 112 //****************************************************************************** 90 BOOL WIN32API GetVolumeInformationW(LPCWSTR arg1, LPWSTR arg2, DWORD arg3, 91 PDWORD arg4, PDWORD arg5, PDWORD arg6, 92 LPWSTR arg7, DWORD arg8) 113 114 ODINFUNCTION8(BOOL, GetVolumeInformationW, 115 LPCWSTR, lpRootPathName, 116 LPWSTR, lpVolumeNameBuffer, 117 DWORD, nVolumeNameSize, 118 PDWORD, lpVolumeSerialNumber, 119 PDWORD, lpMaximumComponentLength, 120 PDWORD, lpFileSystemFlags, 121 LPWSTR, lpFileSystemNameBuffer, 122 DWORD, nFileSystemNameSize) 93 123 { 94 char *asciiroot, *asciivol, *asciifs; 95 BOOL rc; 124 char *asciiroot, 125 *asciivol, 126 *asciifs; 127 BOOL rc; 96 128 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); 129 // transform into ascii 130 asciivol = (char *)malloc(nVolumeNameSize+1); 131 asciifs = (char *)malloc(nFileSystemNameSize+1); 102 132 103 if (arg2 != NULL) /* @@@PH 98/06/07 */ 104 AsciiToUnicode(asciivol, arg2); 133 // clear ascii buffers 134 memset (asciivol, 0, (nVolumeNameSize + 1)); 135 memset (asciifs, 0, (nFileSystemNameSize + 1)); 105 136 106 if (arg7 != NULL) /* @@@PH 98/06/07 */ 107 AsciiToUnicode(asciifs, arg7); 137 if (lpRootPathName != NULL) // NULL is valid! 138 asciiroot = UnicodeToAsciiString((LPWSTR)lpRootPathName); 139 else 140 asciiroot = NULL; 108 141 142 // @@@PH switch to ODIN_ 143 rc = GetVolumeInformationA(asciiroot, 144 asciivol, 145 nVolumeNameSize, 146 lpVolumeSerialNumber, 147 lpMaximumComponentLength, 148 lpFileSystemFlags, 149 asciifs, 150 nFileSystemNameSize); 151 152 if (lpVolumeNameBuffer != NULL) /* @@@PH 98/06/07 */ 153 AsciiToUnicodeN(asciivol, lpVolumeNameBuffer, nVolumeNameSize); 154 155 if (lpFileSystemNameBuffer != NULL) /* @@@PH 98/06/07 */ 156 AsciiToUnicodeN(asciifs, lpFileSystemNameBuffer, nFileSystemNameSize); 157 158 159 if (asciiroot != NULL) 109 160 FreeAsciiString(asciiroot); 110 free(asciifs); 111 free(asciivol); 112 return(rc); 161 162 free(asciifs); 163 free(asciivol); 164 return(rc); 113 165 } 114 166 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.