1 | /* $Id: KERNEL32.CPP,v 1.32 1999-11-19 14:32:55 achimha Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Win32 compatibility file functions for OS/2
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuven
|
---|
7 | * Copyright 1998 Patrick Haller
|
---|
8 | * Copyright 1998 Peter Fitzsimmons
|
---|
9 | * Copyright 1998 Knut St. Osmundsen
|
---|
10 | *
|
---|
11 | * @(#) KERNEL32.CPP 1.0.1 1998/06/12 PH added HandleManager support
|
---|
12 | *
|
---|
13 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
14 | *
|
---|
15 | */
|
---|
16 |
|
---|
17 |
|
---|
18 | /*****************************************************************************
|
---|
19 | * Includes *
|
---|
20 | *****************************************************************************/
|
---|
21 |
|
---|
22 | #include <odin.h>
|
---|
23 | #include <odinwrap.h>
|
---|
24 | #include <os2sel.h>
|
---|
25 |
|
---|
26 | #include <os2win.h>
|
---|
27 | #include <winnt.h>
|
---|
28 | #include <winnls.h>
|
---|
29 | #include <stdlib.h>
|
---|
30 | #include <string.h>
|
---|
31 |
|
---|
32 | #include "misc.h"
|
---|
33 | #include "except.h"
|
---|
34 | #include <builtin.h>
|
---|
35 | #include "heap.h"
|
---|
36 | #include "handlemanager.h"
|
---|
37 | #include "wprocess.h"
|
---|
38 |
|
---|
39 |
|
---|
40 | /*****************************************************************************
|
---|
41 | * Defines *
|
---|
42 | *****************************************************************************/
|
---|
43 |
|
---|
44 | ODINDEBUGCHANNEL(KERNEL32-KERNEL32)
|
---|
45 |
|
---|
46 | /* this define enables certain less important debug messages */
|
---|
47 | //#define DEBUG_LOCAL 1
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | /*****************************************************************************
|
---|
52 | * Name : BOOL WIN32API CloseHandle
|
---|
53 | * Purpose : forward call to Open32
|
---|
54 | * Parameters:
|
---|
55 | * Variables :
|
---|
56 | * Result :
|
---|
57 | * Remark :
|
---|
58 | * Status :
|
---|
59 | *
|
---|
60 | * Author : Patrick Haller [Fri, 1998/06/12 03:44]
|
---|
61 | *****************************************************************************/
|
---|
62 | BOOL WIN32API CloseHandle(HANDLE hHandle)
|
---|
63 | {
|
---|
64 | dprintf(("KERNEL32: CloseHandle(%08xh)\n",
|
---|
65 | hHandle));
|
---|
66 |
|
---|
67 | return HMCloseHandle(hHandle);
|
---|
68 | }
|
---|
69 |
|
---|
70 |
|
---|
71 | //******************************************************************************
|
---|
72 | HANDLE WIN32API GetStdHandle(DWORD fdwDevice)
|
---|
73 | {
|
---|
74 | HANDLE handle;
|
---|
75 |
|
---|
76 | /* @@@PH 1998/02/12 Handle Manager Support */
|
---|
77 | handle = HMGetStdHandle(fdwDevice);
|
---|
78 |
|
---|
79 | //@@@PH translate handle
|
---|
80 |
|
---|
81 | /* handle = GetStdHandle(fdwDevice); */
|
---|
82 | dprintf(("KERNEL32: GetStdHandle for device %X returned %X\n", fdwDevice, handle));
|
---|
83 | return(handle);
|
---|
84 | }
|
---|
85 | //******************************************************************************
|
---|
86 | //******************************************************************************
|
---|
87 | BOOL WIN32API SetStdHandle(DWORD IDStdHandle,
|
---|
88 | HANDLE hHandle)
|
---|
89 | {
|
---|
90 | dprintf(("KERNEL32: SetStdHandle\n"));
|
---|
91 |
|
---|
92 | ///@@@PH translate handle
|
---|
93 |
|
---|
94 | return (HMSetStdHandle(IDStdHandle,
|
---|
95 | hHandle));
|
---|
96 | }
|
---|
97 | //******************************************************************************
|
---|
98 | //******************************************************************************
|
---|
99 | BOOL WIN32API IsBadWritePtr(LPVOID lpvPtr, UINT cbBytes)
|
---|
100 | {
|
---|
101 | #ifdef DEBUG
|
---|
102 | BOOL rc;
|
---|
103 |
|
---|
104 | rc = O32_IsBadWritePtr(lpvPtr, cbBytes);
|
---|
105 | dprintf(("KERNEL32: IsBadWritePtr: 0x%X size %d rc = %d\n", (int)lpvPtr, cbBytes, rc));
|
---|
106 | return(rc);
|
---|
107 | #else
|
---|
108 | return(O32_IsBadWritePtr(lpvPtr, cbBytes));
|
---|
109 | #endif
|
---|
110 | }
|
---|
111 | //******************************************************************************
|
---|
112 | //******************************************************************************
|
---|
113 | BOOL WIN32API IsBadReadPtr(CONST VOID *lpvPtr, UINT cbBytes)
|
---|
114 | {
|
---|
115 | #ifdef DEBUG
|
---|
116 | BOOL rc;
|
---|
117 |
|
---|
118 | rc = O32_IsBadReadPtr(lpvPtr, cbBytes);
|
---|
119 | dprintf(("KERNEL32: IsBadWritePtr: 0x%X size %d rc = %d\n", (int)lpvPtr, cbBytes, rc));
|
---|
120 | return(rc);
|
---|
121 | #else
|
---|
122 | return(O32_IsBadReadPtr(lpvPtr, cbBytes));
|
---|
123 | #endif
|
---|
124 | }
|
---|
125 | //******************************************************************************
|
---|
126 | //******************************************************************************
|
---|
127 | BOOL WIN32API IsBadCodePtr( FARPROC arg1)
|
---|
128 | {
|
---|
129 | dprintf(("KERNEL32: IsBadCodePtr\n"));
|
---|
130 | return O32_IsBadCodePtr(arg1);
|
---|
131 | }
|
---|
132 | //******************************************************************************
|
---|
133 | //******************************************************************************
|
---|
134 | BOOL WIN32API IsBadStringPtrA( LPCSTR arg1, UINT arg2)
|
---|
135 | {
|
---|
136 | dprintf(("KERNEL32: IsBadStringPtr"));
|
---|
137 | return O32_IsBadStringPtr(arg1, arg2);
|
---|
138 | }
|
---|
139 | //******************************************************************************
|
---|
140 | //******************************************************************************
|
---|
141 | BOOL WIN32API IsBadStringPtrW(LPCWSTR arg1, UINT arg2)
|
---|
142 | {
|
---|
143 | dprintf(("KERNEL32: OS2IsBadStringPtrW"));
|
---|
144 | return O32_IsBadReadPtr((CONST VOID *)arg1, arg2*2+2);
|
---|
145 | }
|
---|
146 | //******************************************************************************
|
---|
147 | //******************************************************************************
|
---|
148 | DWORD WIN32API GetLastError()
|
---|
149 | {
|
---|
150 | DWORD rc;
|
---|
151 |
|
---|
152 | rc = O32_GetLastError();
|
---|
153 | #ifdef DEBUG_LOCAL
|
---|
154 | dprintf(("KERNEL32: GetLastError returned %d\n", rc));
|
---|
155 | #endif
|
---|
156 | return(rc);
|
---|
157 | }
|
---|
158 | //******************************************************************************
|
---|
159 | //******************************************************************************
|
---|
160 | VOID WIN32API SetLastError( DWORD arg1)
|
---|
161 | {
|
---|
162 | dprintf2(("KERNEL32: SetLastError to %d\n", arg1));
|
---|
163 | O32_SetLastError(arg1);
|
---|
164 | }
|
---|
165 | //******************************************************************************
|
---|
166 | //******************************************************************************
|
---|
167 | UINT WIN32API GetOEMCP(VOID)
|
---|
168 | {
|
---|
169 | dprintf(("KERNEL32: GetOEMCP\n"));
|
---|
170 | return(O32_GetOEMCP());
|
---|
171 | }
|
---|
172 | //******************************************************************************
|
---|
173 | //******************************************************************************
|
---|
174 | UINT WIN32API GetACP(VOID)
|
---|
175 | {
|
---|
176 | dprintf(("KERNEL32: GetACP\n"));
|
---|
177 | return(O32_GetACP());
|
---|
178 | }
|
---|
179 | //******************************************************************************
|
---|
180 | //******************************************************************************
|
---|
181 | //******************************************************************************
|
---|
182 | //******************************************************************************
|
---|
183 | LPWSTR WIN32API GetEnvironmentStringsW(VOID)
|
---|
184 | {
|
---|
185 | char *envstrings = (char *)O32_GetEnvironmentStrings();
|
---|
186 | char *tmp;
|
---|
187 | LPWSTR wenvstrings;
|
---|
188 | int len, i;
|
---|
189 |
|
---|
190 | dprintf(("KERNEL32: GetEnvironmentStringsW\n"));
|
---|
191 |
|
---|
192 | if(envstrings == NULL)
|
---|
193 | return(NULL);
|
---|
194 |
|
---|
195 | tmp = envstrings;
|
---|
196 | len = 0;
|
---|
197 | while(*tmp != 0)
|
---|
198 | {
|
---|
199 | len += strlen(tmp)+1;
|
---|
200 | tmp = envstrings + len;
|
---|
201 | }
|
---|
202 | len++; //terminating 0
|
---|
203 | wenvstrings = (LPWSTR)malloc(len*sizeof(WCHAR));
|
---|
204 | for(i=0;
|
---|
205 | i<len;
|
---|
206 | i++)
|
---|
207 | {
|
---|
208 | wenvstrings[i] = envstrings[i];
|
---|
209 | }
|
---|
210 | return(wenvstrings);
|
---|
211 | }
|
---|
212 | //******************************************************************************
|
---|
213 | //******************************************************************************
|
---|
214 | BOOL WIN32API FreeEnvironmentStringsA(LPSTR envstrings)
|
---|
215 | {
|
---|
216 | dprintf(("KERNEL32: FreeEnvironmentStringsA\n"));
|
---|
217 | return(TRUE);
|
---|
218 | }
|
---|
219 | //******************************************************************************
|
---|
220 | //******************************************************************************
|
---|
221 | BOOL WIN32API FreeEnvironmentStringsW(LPWSTR envstrings)
|
---|
222 | {
|
---|
223 | dprintf(("KERNEL32: FreeEnvironmentStringsW\n"));
|
---|
224 | free(envstrings);
|
---|
225 | return(TRUE);
|
---|
226 | }
|
---|
227 | //******************************************************************************
|
---|
228 | //******************************************************************************
|
---|
229 | BOOL WIN32API GetStringTypeW(DWORD fdwInfoType, LPCWSTR lpSrcStr, int cchSrc, LPWORD lpCharType)
|
---|
230 | {
|
---|
231 | int i;
|
---|
232 |
|
---|
233 | dprintf(("KERNEL32: GetStringTypeW, not properly implemented\n"));
|
---|
234 | if((DWORD)lpSrcStr == (DWORD)lpCharType || !lpSrcStr || !lpCharType) {
|
---|
235 | O32_SetLastError(ERROR_INVALID_PARAMETER);
|
---|
236 | return(FALSE);
|
---|
237 | }
|
---|
238 | if(cchSrc == -1)
|
---|
239 | cchSrc = UniStrlen((UniChar*)lpSrcStr);
|
---|
240 |
|
---|
241 | memset(lpCharType, 0, cchSrc*sizeof(WORD));
|
---|
242 | switch(fdwInfoType) {
|
---|
243 | case CT_CTYPE1:
|
---|
244 | for(i=0;i<cchSrc;i++) {
|
---|
245 | if(lpSrcStr[i] >= (WCHAR)'a' && lpSrcStr[i] <= (WCHAR)'z')
|
---|
246 | lpCharType[i] |= C1_LOWER | C1_ALPHA;
|
---|
247 | else
|
---|
248 | if(lpSrcStr[i] >= (WCHAR)'A' && lpSrcStr[i] <= (WCHAR)'A')
|
---|
249 | lpCharType[i] |= C1_UPPER | C1_ALPHA;
|
---|
250 | else
|
---|
251 | if(lpSrcStr[i] >= (WCHAR)'0' && lpSrcStr[i] <= (WCHAR)'9')
|
---|
252 | lpCharType[i] |= C1_DIGIT;
|
---|
253 | else
|
---|
254 | if(lpSrcStr[i] >= (WCHAR)' ')
|
---|
255 | lpCharType[i] |= C1_SPACE;
|
---|
256 | }
|
---|
257 | break;
|
---|
258 | case CT_CTYPE2:
|
---|
259 | case CT_CTYPE3: //not supported right now
|
---|
260 | break;
|
---|
261 | }
|
---|
262 | return(TRUE);
|
---|
263 | }
|
---|
264 | //******************************************************************************
|
---|
265 | //NOTE: This has one parameter more than the W version! (@#$@#$)
|
---|
266 | //******************************************************************************
|
---|
267 | BOOL WIN32API GetStringTypeA(LCID Locale, DWORD fdwInfoType, LPCSTR lpSrcStr, int cchSrc, LPWORD lpCharType)
|
---|
268 | {
|
---|
269 | int i;
|
---|
270 |
|
---|
271 | dprintf(("KERNEL32: GetStringTypeA, not properly implemented\n"));
|
---|
272 | if(lpSrcStr == (LPCSTR)lpCharType || !lpSrcStr || !lpCharType) {
|
---|
273 | O32_SetLastError(ERROR_INVALID_PARAMETER);
|
---|
274 | return(FALSE);
|
---|
275 | }
|
---|
276 | if(cchSrc == -1)
|
---|
277 | cchSrc = strlen(lpSrcStr);
|
---|
278 |
|
---|
279 | memset(lpCharType, 0, cchSrc*sizeof(WORD));
|
---|
280 | switch(fdwInfoType) {
|
---|
281 | case CT_CTYPE1:
|
---|
282 | for(i=0;i<cchSrc;i++) {
|
---|
283 | if(lpSrcStr[i] >= 'a' && lpSrcStr[i] <= 'z')
|
---|
284 | lpCharType[i] |= C1_LOWER | C1_ALPHA;
|
---|
285 | else
|
---|
286 | if(lpSrcStr[i] >= 'A' && lpSrcStr[i] <= 'A')
|
---|
287 | lpCharType[i] |= C1_UPPER | C1_ALPHA;
|
---|
288 | else
|
---|
289 | if(lpSrcStr[i] >= '0' && lpSrcStr[i] <= '9')
|
---|
290 | lpCharType[i] |= C1_DIGIT;
|
---|
291 | else
|
---|
292 | if(lpSrcStr[i] >= ' ')
|
---|
293 | lpCharType[i] |= C1_SPACE;
|
---|
294 | }
|
---|
295 | break;
|
---|
296 | case CT_CTYPE2:
|
---|
297 | case CT_CTYPE3: //not supported right now
|
---|
298 | break;
|
---|
299 | }
|
---|
300 | return(TRUE);
|
---|
301 | }
|
---|
302 | //******************************************************************************
|
---|
303 | //******************************************************************************
|
---|
304 | BOOL WIN32API GetStringTypeExW(LCID Locale, DWORD fdwInfoType, LPCWSTR lpSrcStr, int cchSrc, LPWORD lpCharType)
|
---|
305 | {
|
---|
306 | dprintf(("KERNEL32: GetStringTypeExW, not properly implemented\n"));
|
---|
307 | return(GetStringTypeW(fdwInfoType, lpSrcStr, cchSrc, lpCharType));
|
---|
308 | }
|
---|
309 | //******************************************************************************
|
---|
310 | //******************************************************************************
|
---|
311 | BOOL WIN32API GetStringTypeExA(LCID Locale, DWORD fdwInfoType, LPCSTR lpSrcStr, int cchSrc, LPWORD lpCharType)
|
---|
312 | {
|
---|
313 | dprintf(("KERNEL32: GetStringTypeExA, not properly implemented\n"));
|
---|
314 | return(GetStringTypeA(Locale, fdwInfoType, lpSrcStr, cchSrc, lpCharType));
|
---|
315 | }
|
---|
316 | //******************************************************************************
|
---|
317 | //******************************************************************************
|
---|
318 | BOOL WIN32API SetEnvironmentVariableA(LPCSTR arg1, LPCSTR arg2)
|
---|
319 | {
|
---|
320 | dprintf(("KERNEL32: SetEnvironmentVariable %s to %s\n", arg1, arg2));
|
---|
321 | return O32_SetEnvironmentVariable(arg1, arg2);
|
---|
322 | }
|
---|
323 | //******************************************************************************
|
---|
324 | //******************************************************************************
|
---|
325 | BOOL WIN32API SetEnvironmentVariableW(LPCWSTR lpName, LPCWSTR lpValue)
|
---|
326 | {
|
---|
327 | char *asciiname, *asciivalue;
|
---|
328 | BOOL rc;
|
---|
329 |
|
---|
330 | dprintf(("KERNEL32: OS2SetEnvironmentVariableW\n"));
|
---|
331 | asciiname = UnicodeToAsciiString((LPWSTR)lpName);
|
---|
332 | asciivalue = UnicodeToAsciiString((LPWSTR)lpValue);
|
---|
333 | rc = O32_SetEnvironmentVariable(asciiname, asciivalue);
|
---|
334 | FreeAsciiString(asciivalue);
|
---|
335 | FreeAsciiString(asciiname);
|
---|
336 | return(rc);
|
---|
337 | }
|
---|
338 | //******************************************************************************
|
---|
339 | VOID WIN32API GlobalMemoryStatus( MEMORYSTATUS *arg1)
|
---|
340 | {
|
---|
341 | dprintf(("KERNEL32: GlobalMemoryStatus\n"));
|
---|
342 | O32_GlobalMemoryStatus(arg1);
|
---|
343 | dprintf(("dwMemoryLoad %X\n", arg1->dwMemoryLoad));
|
---|
344 | dprintf(("dwTotalPhys %X\n", arg1->dwTotalPhys));
|
---|
345 | dprintf(("dwAvailPhys %X\n", arg1->dwAvailPhys));
|
---|
346 | dprintf(("dwTotalPageFile %X\n", arg1->dwTotalPageFile));
|
---|
347 | dprintf(("dwAvailPageFile %X\n", arg1->dwAvailPageFile));
|
---|
348 | dprintf(("dwTotalVirtual %X\n", arg1->dwTotalVirtual));
|
---|
349 | dprintf(("dwAvailVirtual %X\n", arg1->dwAvailVirtual));
|
---|
350 | }
|
---|
351 | //******************************************************************************
|
---|
352 | //******************************************************************************
|
---|
353 | DWORD WIN32API GetEnvironmentVariableA(LPCSTR arg1, LPSTR arg2, DWORD arg3)
|
---|
354 | {
|
---|
355 | dprintf(("KERNEL32: GetEnvironmentVariable %s\n", arg1));
|
---|
356 | return O32_GetEnvironmentVariable(arg1, arg2, arg3);
|
---|
357 | }
|
---|
358 | //******************************************************************************
|
---|
359 | //******************************************************************************
|
---|
360 | DWORD WIN32API GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer,
|
---|
361 | DWORD nSize)
|
---|
362 | {
|
---|
363 | char *astring, *asciibuffer;
|
---|
364 | DWORD rc;
|
---|
365 |
|
---|
366 | dprintf(("KERNEL32: OS2GetEnvironmentVariableW\n"));
|
---|
367 | asciibuffer = (char *)malloc(nSize+1);
|
---|
368 | *asciibuffer = 0;
|
---|
369 | astring = UnicodeToAsciiString((LPWSTR)lpName);
|
---|
370 |
|
---|
371 | rc = O32_GetEnvironmentVariable(astring, asciibuffer, nSize);
|
---|
372 | AsciiToUnicode(asciibuffer, lpBuffer);
|
---|
373 | FreeAsciiString(astring);
|
---|
374 | free(asciibuffer);
|
---|
375 | return(rc);
|
---|
376 | }
|
---|
377 | //******************************************************************************
|
---|
378 | //******************************************************************************
|
---|
379 | BOOL WIN32API GetExitCodeProcess(HANDLE arg1, LPDWORD arg2)
|
---|
380 | {
|
---|
381 | dprintf(("KERNEL32: GetExitCodeProcess\n"));
|
---|
382 | return O32_GetExitCodeProcess(arg1, arg2);
|
---|
383 | }
|
---|
384 | //******************************************************************************
|
---|
385 | //******************************************************************************
|
---|
386 | HANDLE WIN32API GetCurrentProcess(void)
|
---|
387 | {
|
---|
388 | dprintf2(("KERNEL32: GetCurrentProcess\n"));
|
---|
389 | return O32_GetCurrentProcess();
|
---|
390 | }
|
---|
391 | //******************************************************************************
|
---|
392 | //******************************************************************************
|
---|
393 | DWORD WIN32API GetCurrentProcessId(void)
|
---|
394 | {
|
---|
395 | dprintf2(("KERNEL32: GetCurrentProcessId\n"));
|
---|
396 | return O32_GetCurrentProcessId();
|
---|
397 | }
|
---|
398 | //******************************************************************************
|
---|
399 | //******************************************************************************
|
---|
400 | BOOL WIN32API TerminateProcess( HANDLE arg1, DWORD arg2)
|
---|
401 | {
|
---|
402 | dprintf(("KERNEL32: TerminateProcess\n"));
|
---|
403 | return O32_TerminateProcess(arg1, arg2);
|
---|
404 | }
|
---|
405 | //******************************************************************************
|
---|
406 | //******************************************************************************
|
---|
407 | VOID WIN32API Sleep(DWORD arg1)
|
---|
408 | {
|
---|
409 | dprintf2(("KERNEL32: Sleep %d\n", arg1));
|
---|
410 | O32_Sleep(arg1);
|
---|
411 | }
|
---|
412 | //******************************************************************************
|
---|
413 | //******************************************************************************
|
---|
414 | DWORD WIN32API GetPriorityClass(HANDLE arg1)
|
---|
415 | {
|
---|
416 | dprintf(("KERNEL32: GetPriorityClass\n"));
|
---|
417 | return O32_GetPriorityClass(arg1);
|
---|
418 | }
|
---|
419 | //******************************************************************************
|
---|
420 | //******************************************************************************
|
---|
421 | BOOL WIN32API SetPriorityClass(HANDLE arg1, DWORD arg2)
|
---|
422 | {
|
---|
423 | dprintf(("KERNEL32: SetPriorityClass\n"));
|
---|
424 | return O32_SetPriorityClass(arg1, arg2);
|
---|
425 | }
|
---|
426 | //******************************************************************************
|
---|
427 | //TODO!
|
---|
428 | //******************************************************************************
|
---|
429 | int WIN32API LCMapStringW(
|
---|
430 | DWORD /*LCID*/ Locale,
|
---|
431 | DWORD dwMapFlags,
|
---|
432 | LPCWSTR lpSrcStr,
|
---|
433 | int cchSrc,
|
---|
434 | LPWSTR lpDestStr,
|
---|
435 | int cchDest)
|
---|
436 | {
|
---|
437 | // quick hack! this code is not done!
|
---|
438 | if(cchSrc == -1)
|
---|
439 | cchSrc = strlen((const char *)lpSrcStr);
|
---|
440 | if(!cchDest)
|
---|
441 | return cchSrc;
|
---|
442 | strncpy((char *)lpDestStr, (const char *)lpSrcStr, max(cchSrc, cchDest));
|
---|
443 | return max(cchSrc, cchDest);
|
---|
444 | }
|
---|
445 | //******************************************************************************
|
---|
446 | //TODO!
|
---|
447 | //******************************************************************************
|
---|
448 | int WIN32API LCMapStringA(
|
---|
449 | DWORD /*LCID*/ Locale,
|
---|
450 | DWORD dwMapFlags,
|
---|
451 | LPCSTR lpSrcStr,
|
---|
452 | int cchSrc,
|
---|
453 | LPSTR lpDestStr,
|
---|
454 | int cchDest)
|
---|
455 | {
|
---|
456 | dprintf(("KERNEL32: LCMapStringA not implemented\n"));
|
---|
457 | if(cchSrc == -1)
|
---|
458 | cchSrc = strlen((const char *)lpSrcStr);
|
---|
459 | if(!cchDest)
|
---|
460 | return cchSrc;
|
---|
461 | strncpy((char *)lpDestStr, (const char *)lpSrcStr, max(cchSrc, cchDest));
|
---|
462 | return max(cchSrc, cchDest);
|
---|
463 | }
|
---|
464 | //******************************************************************************
|
---|
465 | //SvL: 24-6-'97 - Added
|
---|
466 | //******************************************************************************
|
---|
467 | BOOL WIN32API Beep( DWORD arg1, DWORD arg2)
|
---|
468 | {
|
---|
469 | dprintf(("KERNEL32: OS2Beep\n"));
|
---|
470 | return O32_Beep(arg1, arg2);
|
---|
471 | }
|
---|
472 | //******************************************************************************
|
---|
473 | //******************************************************************************
|
---|
474 | VOID WIN32API FatalAppExitA( UINT arg1, LPCSTR arg2)
|
---|
475 | {
|
---|
476 | dprintf(("KERNEL32: OS2FatalAppExitA\n"));
|
---|
477 | O32_FatalAppExit(arg1, arg2);
|
---|
478 | }
|
---|
479 | //******************************************************************************
|
---|
480 | //******************************************************************************
|
---|
481 | VOID WIN32API FatalAppExitW(UINT arg1, LPCWSTR arg2)
|
---|
482 | {
|
---|
483 | char *astring;
|
---|
484 |
|
---|
485 | dprintf(("KERNEL32: OS2FatalAppExitW\n"));
|
---|
486 | astring = UnicodeToAsciiString((LPWSTR)arg2);
|
---|
487 | O32_FatalAppExit(arg1, astring);
|
---|
488 | //probably won't return, but who cares..
|
---|
489 | FreeAsciiString(astring);
|
---|
490 | }
|
---|
491 | //******************************************************************************
|
---|
492 | //******************************************************************************
|
---|
493 | VOID WIN32API FatalExit( UINT arg1)
|
---|
494 | {
|
---|
495 | dprintf(("KERNEL32: OS2FatalExit\n"));
|
---|
496 | O32_FatalExit(arg1);
|
---|
497 | }
|
---|
498 | //******************************************************************************
|
---|
499 | //******************************************************************************
|
---|
500 | LPSTR WIN32API GetEnvironmentStringsA(void)
|
---|
501 | {
|
---|
502 | dprintf(("KERNEL32: OS2GetEnvironmentStringsA\n"));
|
---|
503 | return (LPSTR) O32_GetEnvironmentStrings();
|
---|
504 | }
|
---|
505 | //******************************************************************************
|
---|
506 | //******************************************************************************
|
---|
507 | BOOL WIN32API IsBadHugeReadPtr( const void * arg1, UINT arg2)
|
---|
508 | {
|
---|
509 | dprintf(("KERNEL32: OS2IsBadHugeReadPtr\n"));
|
---|
510 | return O32_IsBadHugeReadPtr(arg1, arg2);
|
---|
511 | }
|
---|
512 | //******************************************************************************
|
---|
513 | //******************************************************************************
|
---|
514 | BOOL WIN32API IsBadHugeWritePtr( PVOID arg1, UINT arg2)
|
---|
515 | {
|
---|
516 | dprintf(("KERNEL32: OS2IsBadHugeWritePtr\n"));
|
---|
517 | return O32_IsBadHugeWritePtr(arg1, arg2);
|
---|
518 | }
|
---|
519 | //******************************************************************************
|
---|
520 | //******************************************************************************
|
---|
521 | BOOL WIN32API IsDBCSLeadByte(BYTE arg1)
|
---|
522 | {
|
---|
523 | dprintf(("KERNEL32: OS2IsDBCSLeadByte\n"));
|
---|
524 | return O32_IsDBCSLeadByte(arg1);
|
---|
525 | }
|
---|
526 | //******************************************************************************
|
---|
527 | //******************************************************************************
|
---|
528 | DWORD WIN32API LoadModule( LPCSTR arg1, PVOID arg2)
|
---|
529 | {
|
---|
530 | dprintf(("KERNEL32: OS2LoadModule\n"));
|
---|
531 | return O32_LoadModule(arg1, arg2);
|
---|
532 | }
|
---|
533 | //******************************************************************************
|
---|
534 | //******************************************************************************
|
---|
535 | int WIN32API MulDiv(int arg1, int arg2, int arg3)
|
---|
536 | {
|
---|
537 | dprintf(("KERNEL32: OS2MulDiv %d*%d/%d\n", arg1, arg2, arg3));
|
---|
538 | if(arg3 == 0)
|
---|
539 | return 0;
|
---|
540 |
|
---|
541 | return O32_MulDiv(arg1, arg2, arg3);
|
---|
542 | }
|
---|
543 | //******************************************************************************
|
---|
544 | //******************************************************************************
|
---|
545 | HANDLE WIN32API OpenProcess(DWORD arg1, BOOL arg2, DWORD arg3)
|
---|
546 | {
|
---|
547 | dprintf(("KERNEL32: OS2OpenProcess\n"));
|
---|
548 | return O32_OpenProcess(arg1, arg2, arg3);
|
---|
549 | }
|
---|
550 | //******************************************************************************
|
---|
551 | //******************************************************************************
|
---|
552 | //SvL: BUGFIX: C calling convention!
|
---|
553 | //******************************************************************************
|
---|
554 | VOID __cdecl OS2memmove(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, DWORD Length)
|
---|
555 | {
|
---|
556 | memmove(Destination, Source, Length);
|
---|
557 | }
|
---|
558 | //******************************************************************************
|
---|
559 |
|
---|
560 | //******************************************************************************
|
---|
561 | UINT WIN32API CompareStringA(LCID lcid, DWORD fdwStyle, LPCSTR lpString1,
|
---|
562 | DWORD cch1, LPCSTR lpString2, DWORD cch2)
|
---|
563 | {
|
---|
564 | int i;
|
---|
565 | int fEqual = TRUE;
|
---|
566 | char *string1 = (char *)lpString1, *string2 = (char *)lpString2;
|
---|
567 |
|
---|
568 | #ifdef DEBUG
|
---|
569 | if(fdwStyle & SORT_STRINGSORT)
|
---|
570 | dprintf(("KERNEL32: SORT_STRINGSORT not supported!\n"));
|
---|
571 | if(fdwStyle & NORM_IGNORENONSPACE)
|
---|
572 | dprintf(("KERNEL32: NORM_IGNORENONSPACE not supported!\n"));
|
---|
573 | if(fdwStyle & NORM_IGNORESYMBOLS)
|
---|
574 | dprintf(("KERNEL32: NORM_IGNORESYMBOLS not supported!\n"));
|
---|
575 | #endif
|
---|
576 |
|
---|
577 | if(cch1 == -1) cch1 = strlen(string1);
|
---|
578 | if(cch2 == -1) cch2 = strlen(string2);
|
---|
579 |
|
---|
580 | if(fdwStyle) {
|
---|
581 | //TODO!
|
---|
582 | if(fdwStyle != 0 && fdwStyle != NORM_IGNORECASE)
|
---|
583 | return(0); /*PLF Fri 98-03-13 04:09:32 was return 1 */
|
---|
584 | }
|
---|
585 | if(fdwStyle & NORM_IGNORECASE)
|
---|
586 | fEqual = strnicmp(string1, string2, min(cch1, cch2));
|
---|
587 | else
|
---|
588 | fEqual = strncmp(string1, string2, min(cch1, cch2));
|
---|
589 |
|
---|
590 | if (fEqual < 0 ) fEqual = 1;
|
---|
591 | else if(fEqual == 0) fEqual = 2;
|
---|
592 | else if(fEqual > 0) fEqual = 3;
|
---|
593 |
|
---|
594 | //If equal, but different length, largest one is the greatest in lexical value
|
---|
595 | if(fEqual == 2 && cch1 != cch2){
|
---|
596 | if(cch1 < cch2)
|
---|
597 | fEqual = 1;
|
---|
598 | else
|
---|
599 | fEqual = 3;
|
---|
600 | }
|
---|
601 | dprintf2(("KERNEL32: OS2CompareStringA '%s' - '%s' returned %d\n", lpString1, lpString2, fEqual));
|
---|
602 | return(fEqual);
|
---|
603 | }
|
---|
604 |
|
---|
605 | //******************************************************************************
|
---|
606 | //TODO: Not complete (fdwStyle flags specify compare method)
|
---|
607 | //******************************************************************************
|
---|
608 | UINT WIN32API CompareStringW(LCID lcid, DWORD fdwStyle, LPCWSTR lpString1,
|
---|
609 | DWORD cch1, LPCWSTR lpString2, DWORD cch2)
|
---|
610 | {
|
---|
611 | int i;
|
---|
612 | int fEqual = TRUE;
|
---|
613 | char *string1 = UnicodeToAsciiString((LPWSTR)lpString1);
|
---|
614 | char *string2 = UnicodeToAsciiString((LPWSTR)lpString2);
|
---|
615 |
|
---|
616 | dprintf2(("KERNEL32: OS2CompareStringW '%s' - '%s'\n", string1, string2));
|
---|
617 |
|
---|
618 | fEqual = CompareStringA(lcid, fdwStyle, string1, cch1, string2, cch2);
|
---|
619 | FreeAsciiString(string1);
|
---|
620 | FreeAsciiString(string2);
|
---|
621 |
|
---|
622 | return(fEqual);
|
---|
623 | }
|
---|
624 | //******************************************************************************
|
---|
625 | //******************************************************************************
|
---|
626 | //TODO: Query processor info to complete this api
|
---|
627 | //******************************************************************************
|
---|
628 | VOID WIN32API GetSystemInfo(LPSYSTEM_INFO lpSystemInfo)
|
---|
629 | {
|
---|
630 | dprintf(("KERNEL32: GetSystemInfo, not completely accurate\n"));
|
---|
631 | lpSystemInfo->u.x.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL;
|
---|
632 | lpSystemInfo->u.x.wReserved = 0;
|
---|
633 | lpSystemInfo->dwPageSize = 4096;
|
---|
634 | // as of NT 4.0 SP3
|
---|
635 | lpSystemInfo->lpMinimumApplicationAddress = (LPVOID)0x00010000;
|
---|
636 | //TODO: detect Aurora and increase
|
---|
637 | lpSystemInfo->lpMaximumApplicationAddress = (LPVOID)(512*1024*1024);
|
---|
638 | lpSystemInfo->dwActiveProcessorMask = 1;
|
---|
639 | lpSystemInfo->dwNumberOfProcessors = 1; //assuming non-SMP OS/2
|
---|
640 | lpSystemInfo->dwProcessorType = PROCESSOR_INTEL_PENTIUM;
|
---|
641 | lpSystemInfo->dwAllocationGranularity = 64*1024;
|
---|
642 | lpSystemInfo->wProcessorLevel = 5; //Pentium
|
---|
643 | lpSystemInfo->wProcessorRevision = 0x201; //Model 2 stepping 1 (obviously not correct)
|
---|
644 | }
|
---|
645 | //******************************************************************************
|
---|
646 | //Borrowed from Wine
|
---|
647 | //******************************************************************************
|
---|
648 | ODINPROCEDURE1(GetStartupInfoA,LPSTARTUPINFOA,lpStartupInfo)
|
---|
649 | {
|
---|
650 | lpStartupInfo->cb = sizeof(STARTUPINFOA);
|
---|
651 | lpStartupInfo->lpReserved = "<Reserved>";
|
---|
652 | lpStartupInfo->lpDesktop = "Desktop";
|
---|
653 | lpStartupInfo->lpTitle = "Title";
|
---|
654 | lpStartupInfo->dwX = 0;
|
---|
655 | lpStartupInfo->dwY = 0;
|
---|
656 | lpStartupInfo->dwXSize = 640;
|
---|
657 | lpStartupInfo->dwYSize = 480;
|
---|
658 | lpStartupInfo->dwXCountChars = 80; // for console
|
---|
659 | lpStartupInfo->dwYCountChars = 25;
|
---|
660 | lpStartupInfo->dwFillAttribute = 0x0720;
|
---|
661 | lpStartupInfo->dwFlags = STARTF_USESHOWWINDOW |
|
---|
662 | STARTF_USEPOSITION |
|
---|
663 | STARTF_USESIZE |
|
---|
664 | STARTF_USECOUNTCHARS |
|
---|
665 | STARTF_USEFILLATTRIBUTE|
|
---|
666 | STARTF_USESTDHANDLES;
|
---|
667 | lpStartupInfo->wShowWindow = SW_SHOWDEFAULT;
|
---|
668 | lpStartupInfo->cbReserved2 = 0;
|
---|
669 | lpStartupInfo->lpReserved2 = NULL; /* must be NULL for VC runtime */
|
---|
670 | /* @@@PH 98/07/13 Handlemanager support */
|
---|
671 | lpStartupInfo->hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
---|
672 | lpStartupInfo->hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
---|
673 | lpStartupInfo->hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
---|
674 | return;
|
---|
675 | }
|
---|
676 | //******************************************************************************
|
---|
677 | //Borrowed from Wine
|
---|
678 | //******************************************************************************
|
---|
679 | ODINPROCEDURE1(GetStartupInfoW,LPSTARTUPINFOW,lpStartupInfo)
|
---|
680 | {
|
---|
681 | static WCHAR lpReserved[] = {'<', 'R','e','s','e','r','v','e','d','>', 0};
|
---|
682 | static WCHAR lpDesktop[] = {'D', 'e','s','k','t','o','p', 0};
|
---|
683 | static WCHAR lpTitle[] = {'T', 'i','t','l','e', 0};
|
---|
684 |
|
---|
685 | // forward call to ascii variant
|
---|
686 | GetStartupInfoA((LPSTARTUPINFOA)lpStartupInfo);
|
---|
687 | lpStartupInfo->cb = sizeof(STARTUPINFOW);
|
---|
688 | lpStartupInfo->lpReserved = lpReserved;
|
---|
689 | lpStartupInfo->lpDesktop = lpDesktop;
|
---|
690 | lpStartupInfo->lpTitle = lpTitle;
|
---|
691 | return;
|
---|
692 | }
|
---|
693 | //******************************************************************************
|
---|
694 | //TODO: Not complete or correct, but sufficient for now
|
---|
695 | //******************************************************************************
|
---|
696 | BOOL WIN32API GetBinaryTypeA(LPCTSTR lpApplicationName, LPDWORD lpBinaryType)
|
---|
697 | {
|
---|
698 | dprintf(("KERNEL32: OS2GetBinaryTypeA %s\n", lpApplicationName));
|
---|
699 | if(strstr(lpApplicationName, ".EXE") || strstr(lpApplicationName, ".exe"))
|
---|
700 | *lpBinaryType = SCS_32BIT_BINARY;
|
---|
701 | else
|
---|
702 | if(strstr(lpApplicationName, ".COM") || strstr(lpApplicationName, ".com"))
|
---|
703 | *lpBinaryType = SCS_DOS_BINARY;
|
---|
704 | else
|
---|
705 | if(strstr(lpApplicationName, ".PIF") || strstr(lpApplicationName, ".pif"))
|
---|
706 | *lpBinaryType = SCS_PIF_BINARY;
|
---|
707 | else return(FALSE);
|
---|
708 | return(TRUE);
|
---|
709 | }
|
---|
710 | //******************************************************************************
|
---|
711 | //******************************************************************************
|
---|
712 | BOOL WIN32API GetBinaryTypeW(LPCWSTR lpApplicationName, LPDWORD lpBinaryType)
|
---|
713 | {
|
---|
714 | BOOL rc;
|
---|
715 | char *astring;
|
---|
716 |
|
---|
717 | dprintf(("KERNEL32: OS2GetBinaryTypeW\n"));
|
---|
718 | astring = UnicodeToAsciiString((LPWSTR)lpApplicationName);
|
---|
719 | rc = GetBinaryTypeA(astring, lpBinaryType);
|
---|
720 | FreeAsciiString(astring);
|
---|
721 | return(rc);
|
---|
722 | }
|
---|
723 | //******************************************************************************
|
---|
724 | //TODO: SetLastError
|
---|
725 | //******************************************************************************
|
---|
726 | BOOL WIN32API GetVersionExA(OSVERSIONINFOA *lpVersionInformation)
|
---|
727 | {
|
---|
728 | dprintf(("KERNEL32: OS2GetVersionExA\n"));
|
---|
729 |
|
---|
730 | if(lpVersionInformation == NULL || lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOA))
|
---|
731 | return(FALSE);
|
---|
732 |
|
---|
733 | lpVersionInformation->dwMajorVersion = 4; //pretend we're NT 4.0
|
---|
734 | lpVersionInformation->dwMinorVersion = 0;
|
---|
735 | lpVersionInformation->dwBuildNumber = 0x565;
|
---|
736 | lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
|
---|
737 | strcpy(lpVersionInformation->szCSDVersion, "Service Pack 3");
|
---|
738 | return(TRUE);
|
---|
739 | }
|
---|
740 | //******************************************************************************
|
---|
741 | //******************************************************************************
|
---|
742 | BOOL WIN32API GetVersionExW(OSVERSIONINFOW *lpVersionInformation)
|
---|
743 | {
|
---|
744 | dprintf(("KERNEL32: OS2GetVersionExW\n"));
|
---|
745 |
|
---|
746 | if(lpVersionInformation == NULL || lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOW))
|
---|
747 | return(FALSE);
|
---|
748 |
|
---|
749 | lpVersionInformation->dwMajorVersion = 4; //pretend we're NT 4.0
|
---|
750 | lpVersionInformation->dwMinorVersion = 0;
|
---|
751 | lpVersionInformation->dwBuildNumber = 0x565;
|
---|
752 | lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
|
---|
753 | lstrcpyW(lpVersionInformation->szCSDVersion, (LPWSTR)L"Service Pack 3");
|
---|
754 | return(TRUE);
|
---|
755 | }
|
---|
756 | //******************************************************************************
|
---|
757 | //Should retrieve this from the exe...
|
---|
758 | //******************************************************************************
|
---|
759 | DWORD WIN32API GetProcessVersion(DWORD Processid)
|
---|
760 | {
|
---|
761 | dprintf(("KERNEL32: OS2GetProcessVersion not correctly implemented!!\n"));
|
---|
762 | return(WIN32OS2_VERSION);
|
---|
763 | }
|
---|
764 | //******************************************************************************
|
---|
765 | //******************************************************************************
|
---|
766 | LONG WIN32API GetVersion()
|
---|
767 | {
|
---|
768 | dprintf(("KERNEL32: GetVersion\n"));
|
---|
769 | // highword 0 = NT, lowword high byte major ver, low byte minor ver
|
---|
770 | /* @@@PH 98/04/04 MFC30 makes assumptions about process control block */
|
---|
771 | /* structures that lead to crashes if we don't identify as NT */
|
---|
772 |
|
---|
773 | // return(WIN32OS2_VERSION);
|
---|
774 | return (0x0000004);
|
---|
775 | }
|
---|
776 | //******************************************************************************
|
---|
777 | //SvL: 26-6-'97 - Added
|
---|
778 | //******************************************************************************
|
---|
779 | VOID WIN32API OutputDebugStringW(LPCWSTR arg1)
|
---|
780 | {
|
---|
781 | char *astring;
|
---|
782 |
|
---|
783 | astring = UnicodeToAsciiString((LPWSTR)arg1);
|
---|
784 | dprintf(("KERNEL32: OS2OutputDebugStringW %s\n", astring));
|
---|
785 | FreeAsciiString(astring);
|
---|
786 | }
|
---|
787 | //******************************************************************************
|
---|
788 | //******************************************************************************
|
---|
789 | VOID WIN32API OutputDebugStringA(LPCSTR lpszOutputString)
|
---|
790 | {
|
---|
791 | dprintf(("KERNEL32: OutputDebugStringA: %s\n", lpszOutputString));
|
---|
792 | return;
|
---|
793 | }
|
---|
794 | //******************************************************************************
|
---|
795 | //Obsolete
|
---|
796 | //******************************************************************************
|
---|
797 | DWORD WIN32API GetProcessHeaps(DWORD NumberOfHeaps, PHANDLE ProcessHeaps)
|
---|
798 | {
|
---|
799 | dprintf(("KERNEL32: GetProcessHeaps, Not implemented\n"));
|
---|
800 | return(0);
|
---|
801 | }
|
---|
802 | //******************************************************************************
|
---|
803 | //WINE
|
---|
804 | //******************************************************************************
|
---|
805 | BOOL WIN32API GetProcessAffinityMask(HANDLE hProcess,
|
---|
806 | LPDWORD lpProcessAffinityMask,
|
---|
807 | LPDWORD lpSystemAffinityMask)
|
---|
808 | {
|
---|
809 | /* It is definitely important for a process to know on what processor
|
---|
810 | it is running :-) */
|
---|
811 | if(lpProcessAffinityMask)
|
---|
812 | *lpProcessAffinityMask=1;
|
---|
813 | if(lpSystemAffinityMask)
|
---|
814 | *lpSystemAffinityMask=1;
|
---|
815 | return TRUE;
|
---|
816 | }
|
---|
817 | //******************************************************************************
|
---|
818 | //******************************************************************************
|
---|
819 |
|
---|
820 |
|
---|
821 | BOOL WIN32API FlushInstructionCache( /*PLF Mon 98-02-09 23:56:49 : STUB STUB STUB STUB STUB */
|
---|
822 | HANDLE hProcess, /* process with cache to flush */
|
---|
823 | LPCVOID lpvBase, /* address of region to flush */
|
---|
824 | DWORD cbFlush) /* length of region to flush */
|
---|
825 |
|
---|
826 | {
|
---|
827 | dprintf(("FlushInstructionCache() - NIY\n"));
|
---|
828 | return TRUE;
|
---|
829 | }
|
---|
830 |
|
---|
831 |
|
---|
832 | int WIN32API GetNumberFormatA(LCID Locale,
|
---|
833 | DWORD dwFlags,
|
---|
834 | LPCSTR lpValue,
|
---|
835 | CONST NUMBERFMTA *lpFormat,
|
---|
836 | LPSTR lpNumberStr,
|
---|
837 | int cchNumber)
|
---|
838 | {
|
---|
839 | dprintf(("KERNEL32::OS2GetNumberFormatA(%08x,%08x,%s,%08x,%s,%08x) not implemented.\n",
|
---|
840 | Locale,
|
---|
841 | dwFlags,
|
---|
842 | lpValue,
|
---|
843 | lpFormat,
|
---|
844 | lpNumberStr,
|
---|
845 | cchNumber));
|
---|
846 |
|
---|
847 | return 0;
|
---|
848 | }
|
---|
849 |
|
---|
850 | int WIN32API GetNumberFormatW(LCID Locale,
|
---|
851 | DWORD dwFlags,
|
---|
852 | LPCWSTR lpValue,
|
---|
853 | CONST NUMBERFMTW *lpFormat,
|
---|
854 | LPWSTR lpNumberStr,
|
---|
855 | int cchNumber)
|
---|
856 | {
|
---|
857 | dprintf(("KERNEL32::OS2GetNumberFormatW(%08x,%08x,%s,%08x,%s,%08x) not implemented.\n",
|
---|
858 | Locale,
|
---|
859 | dwFlags,
|
---|
860 | lpValue,
|
---|
861 | lpFormat,
|
---|
862 | lpNumberStr,
|
---|
863 | cchNumber));
|
---|
864 |
|
---|
865 | return 0;
|
---|
866 | }
|
---|
867 |
|
---|
868 | BOOL WIN32API FindCloseChangeNotification(HANDLE hChange)
|
---|
869 | {
|
---|
870 | dprintf(("KERNEL32: OS2FindNextChangeNotification, Not implemented\n"));
|
---|
871 |
|
---|
872 | return(TRUE);
|
---|
873 | }
|
---|
874 |
|
---|
875 | //******************************************************************************
|
---|
876 | //******************************************************************************
|
---|
877 | void WIN32API WrongComctl32()
|
---|
878 | {
|
---|
879 | O32_MessageBox(NULL,
|
---|
880 | "KERNEL32.36 not implemented",
|
---|
881 | "Win32 for OS/2 Error",
|
---|
882 | MB_OK);
|
---|
883 | ExitProcess(987);
|
---|
884 | }
|
---|
885 | //******************************************************************************
|
---|
886 |
|
---|
887 |
|
---|
888 |
|
---|
889 | /***********************************************************************
|
---|
890 | * RtlFillMemory (KERNEL32.441)
|
---|
891 | */
|
---|
892 | VOID WIN32API RtlFillMemory(LPVOID ptr,
|
---|
893 | UINT len,
|
---|
894 | UINT fill )
|
---|
895 | {
|
---|
896 | #ifdef DEBUG_LOCAL
|
---|
897 | dprintf(("KERNEL32: RtlFillMemory(%08x,%08x,%08x)\n",
|
---|
898 | ptr,
|
---|
899 | len,
|
---|
900 | fill));
|
---|
901 | #endif
|
---|
902 |
|
---|
903 | memset(ptr,
|
---|
904 | fill,
|
---|
905 | len );
|
---|
906 | }
|
---|
907 |
|
---|
908 |
|
---|
909 | /***********************************************************************
|
---|
910 | * RtlMoveMemory (KERNEL32.442)
|
---|
911 | */
|
---|
912 | VOID WIN32API RtlMoveMemory(LPVOID dst,
|
---|
913 | LPCVOID src,
|
---|
914 | UINT len )
|
---|
915 | {
|
---|
916 | dprintf2(("KERNEL32: RtlMoveMemory(%08x,%08x,%08x)\n",
|
---|
917 | dst,
|
---|
918 | src,
|
---|
919 | len));
|
---|
920 |
|
---|
921 | memmove(dst,
|
---|
922 | src,
|
---|
923 | len );
|
---|
924 | }
|
---|
925 |
|
---|
926 |
|
---|
927 | /***********************************************************************
|
---|
928 | * RtlZeroMemory (KERNEL32.444)
|
---|
929 | */
|
---|
930 | VOID WIN32API RtlZeroMemory(LPVOID ptr,
|
---|
931 | UINT len)
|
---|
932 | {
|
---|
933 | dprintf2(("KERNEL32: RtlZeroMemory(%08x,%08x)\n",
|
---|
934 | ptr,
|
---|
935 | len));
|
---|
936 |
|
---|
937 | memset(ptr,
|
---|
938 | 0,
|
---|
939 | len);
|
---|
940 | }
|
---|
941 |
|
---|
942 |
|
---|
943 | //******************************************************************************
|
---|
944 | /*KSO Thu 21.05.1998*/
|
---|
945 | BOOL WIN32API IsDBCSLeadByteEx(UINT CodePage, BYTE TestChar)
|
---|
946 | {
|
---|
947 | dprintf(("KERNEL32: OS2IsDBCSLeadByteEx - not correctly implemented\n"));
|
---|
948 | return O32_IsDBCSLeadByte(TestChar);
|
---|
949 | }
|
---|
950 | //******************************************************************************
|
---|
951 |
|
---|
952 |
|
---|
953 |
|
---|
954 |
|
---|
955 |
|
---|
956 |
|
---|
957 |
|
---|
958 |
|
---|