1 | /* $Id: rtlstr.cpp,v 1.5 1999-08-18 18:43:54 phaller Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
5 | * Win32 NT Runtime / NTDLL for OS/2
|
---|
6 | * Rtl string functions
|
---|
7 | *
|
---|
8 | * Copyright 1996-1998 Marcus Meissner
|
---|
9 | * Copyright 1998, 1999 Patrick Haller (phaller@gmx.net)
|
---|
10 | */
|
---|
11 |
|
---|
12 | #include "config.h"
|
---|
13 |
|
---|
14 | #include <stdlib.h>
|
---|
15 | #include <string.h>
|
---|
16 | #include <ctype.h>
|
---|
17 |
|
---|
18 | #include <os2win.h>
|
---|
19 | #include <unicode.h>
|
---|
20 |
|
---|
21 | #include "ntdll.h"
|
---|
22 | #include "windef.h"
|
---|
23 |
|
---|
24 | #define HAVE_WCTYPE_H
|
---|
25 | #ifdef HAVE_WCTYPE_H
|
---|
26 | # include <wctype.h>
|
---|
27 | #endif
|
---|
28 | #include "wine/winestring.h"
|
---|
29 | #include "winnls.h"
|
---|
30 |
|
---|
31 |
|
---|
32 |
|
---|
33 | /*
|
---|
34 | * STRING FUNCTIONS
|
---|
35 | */
|
---|
36 |
|
---|
37 | /**************************************************************************
|
---|
38 | * RtlAnsiStringToUnicodeString [NTDLL.269]
|
---|
39 | */
|
---|
40 | DWORD WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING uni,
|
---|
41 | PANSI_STRING ansi,
|
---|
42 | BOOLEAN doalloc)
|
---|
43 | {
|
---|
44 | DWORD unilen = (ansi->Length+1)*sizeof(WCHAR);
|
---|
45 |
|
---|
46 | dprintf(("NTDLL: RtlAnsiStringToUnicodeString(%08xh,%08xh,%08xh)\n",
|
---|
47 | uni,
|
---|
48 | ansi,
|
---|
49 | doalloc));
|
---|
50 |
|
---|
51 | if (unilen>0xFFFF)
|
---|
52 | return STATUS_INVALID_PARAMETER_2;
|
---|
53 |
|
---|
54 | uni->Length = unilen;
|
---|
55 | if (doalloc)
|
---|
56 | {
|
---|
57 | uni->MaximumLength = unilen;
|
---|
58 | uni->Buffer = (WCHAR *)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,unilen);
|
---|
59 | if (!uni->Buffer)
|
---|
60 | return STATUS_NO_MEMORY;
|
---|
61 | }
|
---|
62 |
|
---|
63 | if (unilen>uni->MaximumLength)
|
---|
64 | return STATUS_BUFFER_OVERFLOW;
|
---|
65 |
|
---|
66 | AsciiToUnicodeN(ansi->Buffer,
|
---|
67 | uni->Buffer,
|
---|
68 | unilen/2);
|
---|
69 |
|
---|
70 | return STATUS_SUCCESS;
|
---|
71 | }
|
---|
72 |
|
---|
73 |
|
---|
74 | /**************************************************************************
|
---|
75 | * RtlOemStringToUnicodeString [NTDLL.447]
|
---|
76 | */
|
---|
77 | DWORD WINAPI RtlOemStringToUnicodeString(PUNICODE_STRING uni,
|
---|
78 | PSTRING ansi,
|
---|
79 | BOOLEAN doalloc)
|
---|
80 | {
|
---|
81 | DWORD unilen = (ansi->Length+1)*sizeof(WCHAR);
|
---|
82 |
|
---|
83 | dprintf(("NTDLL: RtlOemStringToUnicodeString(%08xh,%08xh,%08xh)\n",
|
---|
84 | uni,
|
---|
85 | ansi,
|
---|
86 | doalloc));
|
---|
87 |
|
---|
88 | if (unilen>0xFFFF)
|
---|
89 | return STATUS_INVALID_PARAMETER_2;
|
---|
90 |
|
---|
91 | uni->Length = unilen;
|
---|
92 | if (doalloc)
|
---|
93 | {
|
---|
94 | uni->MaximumLength = unilen;
|
---|
95 | uni->Buffer = (WCHAR *)HeapAlloc(GetProcessHeap(),
|
---|
96 | HEAP_ZERO_MEMORY,
|
---|
97 | unilen);
|
---|
98 |
|
---|
99 | if (!uni->Buffer)
|
---|
100 | return STATUS_NO_MEMORY;
|
---|
101 | }
|
---|
102 |
|
---|
103 | if (unilen>uni->MaximumLength)
|
---|
104 | return STATUS_BUFFER_OVERFLOW;
|
---|
105 |
|
---|
106 | AsciiToUnicodeN(ansi->Buffer,
|
---|
107 | uni->Buffer,
|
---|
108 | unilen/2);
|
---|
109 | return STATUS_SUCCESS;
|
---|
110 | }
|
---|
111 |
|
---|
112 |
|
---|
113 | /**************************************************************************
|
---|
114 | * RtlMultiByteToUnicodeN [NTDLL.436]
|
---|
115 | * FIXME: multibyte support
|
---|
116 | */
|
---|
117 | DWORD WINAPI RtlMultiByteToUnicodeN(LPWSTR unistr,
|
---|
118 | DWORD unilen,
|
---|
119 | LPDWORD reslen,
|
---|
120 | LPSTR oemstr,
|
---|
121 | DWORD oemlen)
|
---|
122 | {
|
---|
123 | DWORD len;
|
---|
124 | LPWSTR x;
|
---|
125 |
|
---|
126 | dprintf(("NTDLL: RtlMultiByteToUnicodeN(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
---|
127 | unistr,
|
---|
128 | unilen,
|
---|
129 | reslen,
|
---|
130 | oemstr,
|
---|
131 | oemlen));
|
---|
132 |
|
---|
133 | len = oemlen;
|
---|
134 |
|
---|
135 | if (unilen/2 < len)
|
---|
136 | len = unilen/2;
|
---|
137 |
|
---|
138 | x=(LPWSTR)HeapAlloc(GetProcessHeap(),
|
---|
139 | HEAP_ZERO_MEMORY,
|
---|
140 | (len+1)*sizeof(WCHAR));
|
---|
141 |
|
---|
142 | AsciiToUnicodeN(oemstr,
|
---|
143 | x,
|
---|
144 | len+1);
|
---|
145 |
|
---|
146 | memcpy(unistr,
|
---|
147 | x,
|
---|
148 | len*2);
|
---|
149 |
|
---|
150 | if (reslen)
|
---|
151 | *reslen = len*2;
|
---|
152 |
|
---|
153 | return 0;
|
---|
154 | }
|
---|
155 |
|
---|
156 |
|
---|
157 | /**************************************************************************
|
---|
158 | * RtlOemToUnicodeN [NTDLL.448]
|
---|
159 | */
|
---|
160 | DWORD WINAPI RtlOemToUnicodeN(LPWSTR unistr,
|
---|
161 | DWORD unilen,
|
---|
162 | LPDWORD reslen,
|
---|
163 | LPSTR oemstr,
|
---|
164 | DWORD oemlen)
|
---|
165 | {
|
---|
166 | DWORD len;
|
---|
167 | LPWSTR x;
|
---|
168 |
|
---|
169 | dprintf(("NTDLL: RtlOemToUnicodeN(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
---|
170 | unistr,
|
---|
171 | unilen,
|
---|
172 | reslen,
|
---|
173 | oemstr,
|
---|
174 | oemlen));
|
---|
175 |
|
---|
176 | len = oemlen;
|
---|
177 |
|
---|
178 | if (unilen/2 < len)
|
---|
179 | len = unilen/2;
|
---|
180 |
|
---|
181 | x=(LPWSTR)HeapAlloc(GetProcessHeap(),
|
---|
182 | HEAP_ZERO_MEMORY,
|
---|
183 | (len+1)*sizeof(WCHAR));
|
---|
184 |
|
---|
185 | AsciiToUnicodeN(oemstr,
|
---|
186 | x,
|
---|
187 | len+1);
|
---|
188 |
|
---|
189 | memcpy(unistr,
|
---|
190 | x,
|
---|
191 | len*2);
|
---|
192 |
|
---|
193 | if (reslen)
|
---|
194 | *reslen = len*2;
|
---|
195 |
|
---|
196 | return 0;
|
---|
197 | }
|
---|
198 |
|
---|
199 |
|
---|
200 | /**************************************************************************
|
---|
201 | * RtlInitAnsiString [NTDLL.399]
|
---|
202 | */
|
---|
203 | VOID WINAPI RtlInitAnsiString(PANSI_STRING target,
|
---|
204 | LPCSTR source)
|
---|
205 | {
|
---|
206 | dprintf(("NTDLL: RtlInitAnsiString(%08xh, %08xh)\n",
|
---|
207 | target,
|
---|
208 | source));
|
---|
209 |
|
---|
210 | target->Length = target->MaximumLength = 0;
|
---|
211 | target->Buffer = (LPSTR)source;
|
---|
212 | if (!source)
|
---|
213 | return;
|
---|
214 |
|
---|
215 | target->MaximumLength = lstrlenA(target->Buffer);
|
---|
216 | target->Length = target->MaximumLength+1;
|
---|
217 | }
|
---|
218 |
|
---|
219 |
|
---|
220 | /**************************************************************************
|
---|
221 | * RtlInitOemString
|
---|
222 | */
|
---|
223 | VOID WINAPI RtlInitOemString(POEM_STRING target,
|
---|
224 | LPCSTR source)
|
---|
225 | {
|
---|
226 | dprintf(("NTDLL: RtlInitOemString(%08xh, %08xh)\n",
|
---|
227 | target,
|
---|
228 | source));
|
---|
229 |
|
---|
230 | target->Length = target->MaximumLength = 0;
|
---|
231 | target->Buffer = (LPSTR)source;
|
---|
232 | if (!source)
|
---|
233 | return;
|
---|
234 |
|
---|
235 | target->MaximumLength = lstrlenA(target->Buffer);
|
---|
236 | target->Length = target->MaximumLength+1;
|
---|
237 | }
|
---|
238 |
|
---|
239 |
|
---|
240 |
|
---|
241 | /**************************************************************************
|
---|
242 | * RtlInitString [NTDLL.402]
|
---|
243 | */
|
---|
244 | VOID WINAPI RtlInitString(PSTRING target,
|
---|
245 | LPCSTR source)
|
---|
246 | {
|
---|
247 | dprintf (("NTDLL: RtlInitString(%08xh, %08xh)\n",
|
---|
248 | target,
|
---|
249 | source));
|
---|
250 |
|
---|
251 | target->Length = target->MaximumLength = 0;
|
---|
252 | target->Buffer = (LPSTR)source;
|
---|
253 | if (!source)
|
---|
254 | return;
|
---|
255 |
|
---|
256 | target->MaximumLength = lstrlenA(target->Buffer);
|
---|
257 | target->Length = target->MaximumLength+1;
|
---|
258 | }
|
---|
259 |
|
---|
260 |
|
---|
261 | /**************************************************************************
|
---|
262 | * RtlInitUnicodeString [NTDLL.403]
|
---|
263 | */
|
---|
264 | VOID WINAPI RtlInitUnicodeString(PUNICODE_STRING target,
|
---|
265 | LPCWSTR source)
|
---|
266 | {
|
---|
267 | dprintf(("NTDLL: RtlInitUnicodeString(%08xh,%08xh)\n",
|
---|
268 | target,
|
---|
269 | source));
|
---|
270 |
|
---|
271 | target->Length = target->MaximumLength = 0;
|
---|
272 | target->Buffer = (LPWSTR)source;
|
---|
273 | if (!source)
|
---|
274 | return;
|
---|
275 |
|
---|
276 | target->MaximumLength = lstrlenW(target->Buffer)*2;
|
---|
277 | target->Length = target->MaximumLength+2;
|
---|
278 | }
|
---|
279 |
|
---|
280 |
|
---|
281 | /**************************************************************************
|
---|
282 | * RtlFreeUnicodeString [NTDLL.377]
|
---|
283 | */
|
---|
284 | VOID WINAPI RtlFreeUnicodeString(PUNICODE_STRING str)
|
---|
285 | {
|
---|
286 | dprintf(("NTDLL: RtlFreeUnicodeString(%08xh)\n",
|
---|
287 | str));
|
---|
288 |
|
---|
289 | if (str->Buffer)
|
---|
290 | HeapFree(GetProcessHeap(),
|
---|
291 | 0,
|
---|
292 | str->Buffer);
|
---|
293 | }
|
---|
294 |
|
---|
295 |
|
---|
296 | /**************************************************************************
|
---|
297 | * RtlFreeAnsiString [NTDLL.373]
|
---|
298 | */
|
---|
299 | VOID WINAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
|
---|
300 | {
|
---|
301 | dprintf(("NTDLL: RtlFreeAnsiString(%08xh)\n",
|
---|
302 | AnsiString));
|
---|
303 |
|
---|
304 | if( AnsiString->Buffer )
|
---|
305 | HeapFree(GetProcessHeap(),
|
---|
306 | 0,
|
---|
307 | AnsiString->Buffer);
|
---|
308 | }
|
---|
309 |
|
---|
310 |
|
---|
311 | /**************************************************************************
|
---|
312 | * RtlFreeOemString
|
---|
313 | */
|
---|
314 | VOID WINAPI RtlFreeOemString(POEM_STRING OemString)
|
---|
315 | {
|
---|
316 | dprintf(("NTDLL: RtlFreeOemString(%08xh)\n",
|
---|
317 | OemString));
|
---|
318 |
|
---|
319 | if( OemString->Buffer )
|
---|
320 | HeapFree(GetProcessHeap(),
|
---|
321 | 0,
|
---|
322 | OemString->Buffer);
|
---|
323 | }
|
---|
324 |
|
---|
325 |
|
---|
326 |
|
---|
327 | /**************************************************************************
|
---|
328 | * RtlUnicodeToOemN [NTDLL.515]
|
---|
329 | */
|
---|
330 | DWORD WINAPI RtlUnicodeToOemN(LPSTR oemstr,
|
---|
331 | DWORD oemlen,
|
---|
332 | LPDWORD reslen,
|
---|
333 | LPWSTR unistr,
|
---|
334 | DWORD unilen)
|
---|
335 | {
|
---|
336 | DWORD len;
|
---|
337 | LPSTR x;
|
---|
338 |
|
---|
339 | dprintf(("NTDLL: RtlUnicodeToOemN(%08xh,%08xh,%08xh,%08xh,%08xh)\n",
|
---|
340 | oemstr,
|
---|
341 | oemlen,
|
---|
342 | reslen,
|
---|
343 | unistr,
|
---|
344 | unilen));
|
---|
345 |
|
---|
346 | len = oemlen;
|
---|
347 |
|
---|
348 | if (unilen/2 < len)
|
---|
349 | len = unilen/2;
|
---|
350 |
|
---|
351 | x=(LPSTR)HeapAlloc(GetProcessHeap(),
|
---|
352 | HEAP_ZERO_MEMORY,
|
---|
353 | len+1);
|
---|
354 |
|
---|
355 | UnicodeToAsciiN(unistr,
|
---|
356 | x,
|
---|
357 | len+1);
|
---|
358 |
|
---|
359 | memcpy(oemstr,
|
---|
360 | x,
|
---|
361 | len);
|
---|
362 |
|
---|
363 | if (reslen)
|
---|
364 | *reslen = len;
|
---|
365 |
|
---|
366 | return 0;
|
---|
367 | }
|
---|
368 |
|
---|
369 |
|
---|
370 | /**************************************************************************
|
---|
371 | * RtlUnicodeStringToOemString [NTDLL.511]
|
---|
372 | */
|
---|
373 | DWORD WINAPI RtlUnicodeStringToOemString(PANSI_STRING oem,
|
---|
374 | PUNICODE_STRING uni,
|
---|
375 | BOOLEAN alloc)
|
---|
376 | {
|
---|
377 | dprintf(("NTDLL: RtlUnicodeStringToOemString(%08xh,%08xh,%08xh)\n",
|
---|
378 | oem,
|
---|
379 | uni,
|
---|
380 | alloc));
|
---|
381 |
|
---|
382 | if (alloc)
|
---|
383 | {
|
---|
384 | oem->Buffer = (LPSTR)HeapAlloc(GetProcessHeap(),
|
---|
385 | HEAP_ZERO_MEMORY,
|
---|
386 | uni->Length/2)+1;
|
---|
387 | oem->MaximumLength = uni->Length/2+1;
|
---|
388 | }
|
---|
389 |
|
---|
390 | oem->Length = uni->Length/2;
|
---|
391 | UnicodeToAsciiN(uni->Buffer,
|
---|
392 | oem->Buffer,
|
---|
393 | oem->MaximumLength);
|
---|
394 | return 0;
|
---|
395 | }
|
---|
396 |
|
---|
397 | /**************************************************************************
|
---|
398 | * RtlUnicodeStringToAnsiString [NTDLL.507]
|
---|
399 | */
|
---|
400 | DWORD WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING oem,
|
---|
401 | PUNICODE_STRING uni,
|
---|
402 | BOOLEAN alloc)
|
---|
403 | {
|
---|
404 | dprintf(("NTDLL: RtlUnicodeStringToAnsiString(%08xh,%08xh,%08xh)\n",
|
---|
405 | oem,
|
---|
406 | uni,
|
---|
407 | alloc));
|
---|
408 |
|
---|
409 | if (alloc)
|
---|
410 | {
|
---|
411 | oem->Buffer = (LPSTR)HeapAlloc(GetProcessHeap(),
|
---|
412 | HEAP_ZERO_MEMORY,
|
---|
413 | uni->Length/2)+1;
|
---|
414 | oem->MaximumLength = uni->Length/2+1;
|
---|
415 | }
|
---|
416 |
|
---|
417 | oem->Length = uni->Length/2;
|
---|
418 | UnicodeToAsciiN(uni->Buffer,
|
---|
419 | oem->Buffer,
|
---|
420 | oem->MaximumLength);
|
---|
421 |
|
---|
422 | return 0;
|
---|
423 | }
|
---|
424 |
|
---|
425 | /**************************************************************************
|
---|
426 | * RtlEqualUnicodeString [NTDLL]
|
---|
427 | */
|
---|
428 | DWORD WINAPI RtlEqualUnicodeString(PUNICODE_STRING s1,
|
---|
429 | PUNICODE_STRING s2,
|
---|
430 | DWORD x)
|
---|
431 | {
|
---|
432 | dprintf(("NTDLL: RtlEqualUnicodeString(%08xh,%08xh,%08xh)\n",
|
---|
433 | s1,
|
---|
434 | s2,
|
---|
435 | x));
|
---|
436 |
|
---|
437 | if (s1->Length != s2->Length)
|
---|
438 | return 1;
|
---|
439 |
|
---|
440 | return !lstrncmpW(s1->Buffer,
|
---|
441 | s2->Buffer,
|
---|
442 | s1->Length/2);
|
---|
443 | }
|
---|
444 |
|
---|
445 |
|
---|
446 | /**************************************************************************
|
---|
447 | * RtlUpcaseUnicodeString [NTDLL.520]
|
---|
448 | */
|
---|
449 | DWORD WINAPI RtlUpcaseUnicodeString(PUNICODE_STRING dest,
|
---|
450 | PUNICODE_STRING src,
|
---|
451 | BOOLEAN doalloc)
|
---|
452 | {
|
---|
453 | LPWSTR s,t;
|
---|
454 | DWORD i,len;
|
---|
455 |
|
---|
456 | dprintf(("NTDLL: RtlUpcaseUnicodeString(%08xh,%08xh,%08xh)\n",
|
---|
457 | dest,
|
---|
458 | src,
|
---|
459 | doalloc));
|
---|
460 |
|
---|
461 | len = src->Length;
|
---|
462 | if (doalloc)
|
---|
463 | {
|
---|
464 | dest->MaximumLength = len;
|
---|
465 | dest->Buffer = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
---|
466 | HEAP_ZERO_MEMORY,
|
---|
467 | len);
|
---|
468 | if (!dest->Buffer)
|
---|
469 | return STATUS_NO_MEMORY;
|
---|
470 | }
|
---|
471 |
|
---|
472 | if (dest->MaximumLength < len)
|
---|
473 | return STATUS_BUFFER_OVERFLOW;
|
---|
474 |
|
---|
475 | s=dest->Buffer;
|
---|
476 | t=src->Buffer;
|
---|
477 |
|
---|
478 | /* len is in bytes */
|
---|
479 | #if 0
|
---|
480 | for (i = 0;
|
---|
481 | i < len/2;
|
---|
482 | i++)
|
---|
483 | s[i] = towupper(t[i]);
|
---|
484 | #endif
|
---|
485 | return STATUS_SUCCESS;
|
---|
486 | }
|
---|
487 |
|
---|
488 |
|
---|
489 | /**************************************************************************
|
---|
490 | * RtlxOemStringToUnicodeSize [NTDLL.549]
|
---|
491 | */
|
---|
492 | UINT WINAPI RtlxOemStringToUnicodeSize(PSTRING str)
|
---|
493 | {
|
---|
494 | dprintf(("NTDLL: RtlxOemStringToUnicodeSize(%08xh)\n",
|
---|
495 | str));
|
---|
496 |
|
---|
497 | return str->Length*2+2;
|
---|
498 | }
|
---|
499 |
|
---|
500 |
|
---|
501 | /**************************************************************************
|
---|
502 | * RtlxAnsiStringToUnicodeSize [NTDLL.548]
|
---|
503 | */
|
---|
504 | UINT WINAPI RtlxAnsiStringToUnicodeSize(PANSI_STRING str)
|
---|
505 | {
|
---|
506 | dprintf(("NTDLL: RtlxAnsiStringToUnicodeSize(%08xh)\n",
|
---|
507 | str));
|
---|
508 |
|
---|
509 | return str->Length*2+2;
|
---|
510 | }
|
---|
511 |
|
---|
512 |
|
---|
513 | /**************************************************************************
|
---|
514 | * RtlIsTextUnicode [NTDLL.417]
|
---|
515 | *
|
---|
516 | * Apply various feeble heuristics to guess whether
|
---|
517 | * the text buffer contains Unicode.
|
---|
518 | * FIXME: should implement more tests.
|
---|
519 | */
|
---|
520 | DWORD WINAPI RtlIsTextUnicode(LPVOID buf,
|
---|
521 | DWORD len,
|
---|
522 | DWORD *pf)
|
---|
523 | {
|
---|
524 | LPWSTR s = (LPWSTR)buf;
|
---|
525 | DWORD flags = -1,
|
---|
526 | out_flags = 0;
|
---|
527 |
|
---|
528 | dprintf(("NTDLL: RtlIsTextUnicode(%08xh,%08xh,%08xh)\n",
|
---|
529 | buf,
|
---|
530 | len,
|
---|
531 | pf));
|
---|
532 |
|
---|
533 | if (!len)
|
---|
534 | goto out;
|
---|
535 |
|
---|
536 | if (pf)
|
---|
537 | flags = *pf;
|
---|
538 |
|
---|
539 | /*
|
---|
540 | * Apply various tests to the text string. According to the
|
---|
541 | * docs, each test "passed" sets the corresponding flag in
|
---|
542 | * the output flags. But some of the tests are mutually
|
---|
543 | * exclusive, so I don't see how you could pass all tests ...
|
---|
544 | */
|
---|
545 |
|
---|
546 | /* Check for an odd length ... pass if even. */
|
---|
547 | if (!(len & 1))
|
---|
548 | out_flags |= IS_TEXT_UNICODE_ODD_LENGTH;
|
---|
549 |
|
---|
550 | /* Check for the special unicode marker byte. */
|
---|
551 | if (*s == 0xFEFF)
|
---|
552 | out_flags |= IS_TEXT_UNICODE_SIGNATURE;
|
---|
553 |
|
---|
554 | /*
|
---|
555 | * Check whether the string passed all of the tests.
|
---|
556 | */
|
---|
557 | flags &= ITU_IMPLEMENTED_TESTS;
|
---|
558 | if ((out_flags & flags) != flags)
|
---|
559 | len = 0;
|
---|
560 |
|
---|
561 | out:
|
---|
562 | if (pf)
|
---|
563 | *pf = out_flags;
|
---|
564 |
|
---|
565 | return len;
|
---|
566 | }
|
---|
567 |
|
---|
568 |
|
---|
569 | /******************************************************************************
|
---|
570 | * RtlCompareUnicodeString [NTDLL]
|
---|
571 | */
|
---|
572 | DWORD WINAPI RtlCompareUnicodeString(PUNICODE_STRING String1,
|
---|
573 | PUNICODE_STRING String2,
|
---|
574 | BOOLEAN CaseInSensitive)
|
---|
575 | {
|
---|
576 | dprintf(("NTDLL: RtlCompareUnicodeString(%08xh,%08xh,%08xh) not implemented.\n",
|
---|
577 | String1,
|
---|
578 | String2,
|
---|
579 | CaseInSensitive));
|
---|
580 |
|
---|
581 | return 0;
|
---|
582 | }
|
---|
583 |
|
---|
584 |
|
---|
585 |
|
---|
586 | /**************************************************************************
|
---|
587 | * RtlUpcaseUnicodeStringToOemString [NTDLL.?]
|
---|
588 | * @@@PH: parameters are pure speculation!
|
---|
589 | */
|
---|
590 | DWORD WINAPI RtlUpcaseUnicodeStringToOemString(PANSI_STRING oem,
|
---|
591 | PUNICODE_STRING uni,
|
---|
592 | BOOLEAN alloc)
|
---|
593 | {
|
---|
594 | DWORD rc;
|
---|
595 |
|
---|
596 | dprintf(("NTDLL: RtlUpcaseUnicodeStringToOemString(%08xh,%08xh,%08xh)\n",
|
---|
597 | oem,
|
---|
598 | uni,
|
---|
599 | alloc));
|
---|
600 |
|
---|
601 | rc = RtlUnicodeStringToOemString(oem,
|
---|
602 | uni,
|
---|
603 | alloc);
|
---|
604 | if (rc == 0)
|
---|
605 | strupr(oem->Buffer);
|
---|
606 |
|
---|
607 | return rc;
|
---|
608 | }
|
---|
609 |
|
---|
610 |
|
---|