ReactOS 0.4.16-dev-1308-gbf734eb
misc.c
Go to the documentation of this file.
1/*
2 * Unit tests for miscellaneous msvcrt functions
3 *
4 * Copyright 2010 Andrew Nguyen
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "wine/test.h"
22#include <errno.h>
23#include <fcntl.h>
24#include <io.h>
25#include <stdio.h>
26#include <math.h>
27#include <process.h>
28#ifdef __REACTOS__
29#include <versionhelpers.h>
30#endif
31
32static inline BOOL almost_equal(double d1, double d2) {
33 if(d1-d2>-1e-30 && d1-d2<1e-30)
34 return TRUE;
35 return FALSE;
36}
37
38/* MS' "long double" is an 80 bit FP that takes 12 bytes*/
39struct uld { ULONG lo, hi, exp; };
40
41static int (__cdecl *prand_s)(unsigned int *);
42static int (__cdecl *pI10_OUTPUT)(struct uld, int, int, void*);
43static int (__cdecl *pstrerror_s)(char *, size_t, int);
44static int (__cdecl *p_get_doserrno)(int *);
45static int (__cdecl *p_get_errno)(int *);
46static int (__cdecl *p_set_doserrno)(int);
47static int (__cdecl *p_set_errno)(int);
48static void (__cdecl *p__invalid_parameter)(const wchar_t*,
49 const wchar_t*, const wchar_t*, unsigned int, uintptr_t);
50static void (__cdecl *p_qsort_s)(void*, size_t, size_t,
51 int (__cdecl*)(void*, const void*, const void*), void*);
52static double (__cdecl *p_atan)(double);
53static double (__cdecl *p_exp)(double);
54static double (__cdecl *p_tanh)(double);
55static void *(__cdecl *p_lfind_s)(const void*, const void*, unsigned int*,
56 size_t, int (__cdecl *)(void*, const void*, const void*), void*);
57
58static void init(void)
59{
60 HMODULE hmod = GetModuleHandleA("msvcrt.dll");
61
62 prand_s = (void *)GetProcAddress(hmod, "rand_s");
63 pI10_OUTPUT = (void*)GetProcAddress(hmod, "$I10_OUTPUT");
64 pstrerror_s = (void *)GetProcAddress(hmod, "strerror_s");
65 p_get_doserrno = (void *)GetProcAddress(hmod, "_get_doserrno");
66 p_get_errno = (void *)GetProcAddress(hmod, "_get_errno");
67 p_set_doserrno = (void *)GetProcAddress(hmod, "_set_doserrno");
68 p_set_errno = (void *)GetProcAddress(hmod, "_set_errno");
69 p__invalid_parameter = (void *)GetProcAddress(hmod, "_invalid_parameter");
70 p_qsort_s = (void *)GetProcAddress(hmod, "qsort_s");
71 p_atan = (void *)GetProcAddress(hmod, "atan");
72 p_exp = (void *)GetProcAddress(hmod, "exp");
73 p_tanh = (void *)GetProcAddress(hmod, "tanh");
74 p_lfind_s = (void *)GetProcAddress(hmod, "_lfind_s");
75}
76
77static void test_rand_s(void)
78{
79 int ret;
80 unsigned int rand;
81
82 if (!prand_s)
83 {
84 win_skip("rand_s is not available\n");
85 return;
86 }
87
88 errno = EBADF;
89 ret = prand_s(NULL);
90 ok(ret == EINVAL, "Expected rand_s to return EINVAL, got %d\n", ret);
91 ok(errno == EINVAL, "Expected errno to return EINVAL, got %d\n", errno);
92
93 ret = prand_s(&rand);
94 ok(ret == 0, "Expected rand_s to return 0, got %d\n", ret);
95}
96
97typedef struct _I10_OUTPUT_data {
98 short pos;
99 char sign;
101 char str[100];
103
104typedef struct _I10_OUTPUT_test {
105 struct uld d;
106 int size;
107 int flags;
108
110 int ret;
111 const char *remain;
113
115 /* arg3 = 0 */
116 { { 0x00000000, 0x00000000, 0x0000 /* 0.0 */ }, 10, 0, {0, ' ', 1, "0"}, 1, "" },
117 { { 0x00000000, 0x80000000, 0x3fff /* 1.0 */ }, 10, 0, {1, ' ', 1, "1"}, 1, "000000009" },
118 { { 0x00000000, 0x80000000, 0xbfff /* -1.0 */ }, 10, 0, {1, '-', 1, "1"}, 1, "000000009" },
119 { { 0x0a3d7000, 0x9d70a3d7, 0x3fff /* 1.23 */ }, 10, 0, {1, ' ', 3, "123"}, 1, "0000009" },
120 { { 0x00000000, 0x9184e72a, 0x402a /* 1e13 */ }, 10, 0, {14, ' ', 1, "1"}, 1, "000000009" },
121 { { 0x04675000, 0xc9f2c9cd, 0x4062 /* 1e30 */ }, 30, 0, {31, ' ', 21, "100000000000000001988"}, 1, "" },
122 { { 0x4bb41000, 0xe12e1342, 0x3fd3 /* 1e-13 */ }, 10, 0, {-12, ' ', 1, "1"}, 1, "000000000" },
123 { { 0x00000000, 0x80000000, 0x3ffd /* 0.25 */ }, 10, 0, {0, ' ', 2, "25"}, 1, "00000000" },
124 { { 0xbf94d800, 0x800000d6, 0x3fff /* 1.0000001 */ }, 10, 0, {1, ' ', 8, "10000001"}, 1, "00" },
125 { { 0x00000000, 0x80000000, 0x7fff /* +inf */ }, 10, 0, {1, ' ', 5, "1#INF"}, 0, "" },
126 { { 0x00000000, 0x80000000, 0xffff /* -inf */ }, 10, 0, {1, '-', 5, "1#INF"}, 0, "" },
127 { { 0x00000001, 0x80000000, 0x7fff /* snan */ }, 10, 0, {1, ' ', 6, "1#SNAN"}, 0, "" },
128 { { 0x00000001, 0x80000000, 0xffff /* snan */ }, 10, 0, {1, '-', 6, "1#SNAN"}, 0, "" },
129 { { 0x00000000, 0xc0000000, 0x7fff /* qnan */ }, 10, 0, {1, ' ', 6, "1#QNAN"}, 0, "" },
130 { { 0x00000000, 0x40000000, 0xffff /* qnan */ }, 10, 0, {1, '-', 6, "1#QNAN"}, 0, "" },
131 /* arg3 = 1 */
132 { { 0x00000000, 0x00000000, 0x0000 /* 0 */ }, 10, 1, {0, ' ', 1, "0"}, 1, "" },
133 { { 0x00000000, 0x80000000, 0x3fff /* 1 */ }, 10, 1, {1, ' ', 1, "1"}, 1, "0000000009" },
134 { { 0x00000000, 0x80000000, 0xbfff /* -1 */ }, 10, 1, {1, '-', 1, "1"}, 1, "0000000009" },
135 { { 0x0a3d7000, 0x9d70a3d7, 0x3fff /* 1.23 */ }, 10, 1, {1, ' ', 3, "123"}, 1, "00000009" },
136 { { 0x00000000, 0x9184e72a, 0x402a /* 1e13 */ }, 10, 1, {14, ' ', 1, "1"}, 1, "00000000000000000009" },
137 { { 0x04675000, 0xc9f2c9cd, 0x4062 /* 1e30 */ }, 30, 1, {31, ' ', 21, "100000000000000001988"}, 1, "" },
138 { { 0x4bb41000, 0xe12e1342, 0x3fd3 /* 1e-13 */ }, 10, 1, {0, ' ', 1, "0"}, 1, "" },
139 { { 0xe57a4000, 0xd6bf94d5, 0x3fe7 /* 1e-7 */ }, 10, 1, {-6, ' ', 1, "1"}, 1, "09" },
140 { { 0x00000000, 0x80000000, 0x3ffd /* 0.25 */ }, 10, 1, {0, ' ', 2, "25"}, 1, "00000000" },
141 { { 0xbf94d800, 0x800000d6, 0x3fff /* 1.0000001 */ }, 10, 1, {1, ' ', 8, "10000001"}, 1, "000" },
142 { { 0x00000000, 0x80000000, 0x7fff /* +inf */ }, 10, 1, {1, ' ', 5, "1#INF"}, 0, "" },
143 { { 0x00000000, 0x80000000, 0xffff /* -inf */ }, 10, 1, {1, '-', 5, "1#INF"}, 0, "" },
144 { { 0x00000001, 0x80000000, 0x7fff /* snan */ }, 10, 1, {1, ' ', 6, "1#SNAN"}, 0, "" },
145 { { 0x00000000, 0xc0000000, 0x7fff /* qnan */ }, 10, 1, {1, ' ', 6, "1#QNAN"}, 0, "" },
146 { { 0x00000000, 0x40000000, 0x7fff /* qnan */ }, 10, 1, {1, ' ', 6, "1#QNAN"}, 0, "" },
147 /* too small buffer */
148 { { 0x00000000, 0x00000000, 0x0000 /* 0 */ }, 0, 0, {0, ' ', 1, "0"}, 1, "" },
149 { { 0x00000000, 0x00000000, 0x0000 /* 0 */ }, 0, 1, {0, ' ', 1, "0"}, 1, "" },
150 { { 0x00000000, 0xf6000000, 0x4005 /* 123 */ }, 2, 0, {3, ' ', 2, "12"}, 1, "" },
151 { { 0x00000000, 0xf6000000, 0x4005 /* 123 */ }, 0, 0, {0, ' ', 1, "0"}, 1, "" },
152 { { 0x00000000, 0xf6000000, 0x4005 /* 123 */ }, 2, 1, {3, ' ', 3, "123"}, 1, "09" },
153 { { 0x0a3d7000, 0xfd70a3d7, 0x3ffe /* 0.99 */ }, 1, 0, {1, ' ', 1, "1"}, 1, "" },
154 { { 0x00000000, 0x9a5db800, 0x4013 /* 1264567.0 */ }, 2, 0, {7, ' ', 2, "13"}, 1, "" },
155 { { 0x00000000, 0x9a5db800, 0x4013 /* 1264567.0 */ }, 2, 1, {7, ' ', 7, "1264567"}, 1, "00" },
156 { { 0x00000000, 0x932c05a6, 0x401d /* 1234567891.0 */ }, 2, 1, {10, ' ', 10, "1234567891"}, 1, "09" }
157};
158
159static void test_I10_OUTPUT(void)
160{
162 int i, j, ret;
163
164 if(!pI10_OUTPUT) {
165 win_skip("I10_OUTPUT not available\n");
166 return;
167 }
168
169 for(i=0; i<ARRAY_SIZE(I10_OUTPUT_tests); i++) {
170 memset(out.str, '#', sizeof(out.str));
172 ok(ret == I10_OUTPUT_tests[i].ret, "%d: ret = %d\n", i, ret);
173 ok(out.pos == I10_OUTPUT_tests[i].out.pos, "%d: out.pos = %hd\n", i, out.pos);
174 ok(out.sign == I10_OUTPUT_tests[i].out.sign, "%d: out.size = %c\n", i, out.sign);
175 ok(out.len == I10_OUTPUT_tests[i].out.len, "%d: out.len = %d\n", i, (int)out.len);
176 ok(!strcmp(out.str, I10_OUTPUT_tests[i].out.str), "%d: out.str = %s\n", i, out.str);
177
178 j = strlen(I10_OUTPUT_tests[i].remain);
179 todo_wine_if(j && I10_OUTPUT_tests[i].remain[j-1]=='9')
180 ok(!strncmp(out.str+out.len+1, I10_OUTPUT_tests[i].remain, j),
181 "%d: &out.str[%d] = %.25s...\n", i, out.len+1, out.str+out.len+1);
182
183 for(j=out.len+strlen(I10_OUTPUT_tests[i].remain)+1; j<sizeof(out.str); j++)
184 if(out.str[j] != '#')
185 ok(0, "%d: out.str[%d] = %c (expected \'#\')\n", i, j, out.str[j]);
186 }
187}
188
189static void test_strerror_s(void)
190{
191 int ret;
192 char buf[256];
193
194 if (!pstrerror_s)
195 {
196 win_skip("strerror_s is not available\n");
197 return;
198 }
199
200 errno = EBADF;
201 ret = pstrerror_s(NULL, 0, 0);
202 ok(ret == EINVAL, "Expected strerror_s to return EINVAL, got %d\n", ret);
203 ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno);
204
205 errno = EBADF;
206 ret = pstrerror_s(NULL, sizeof(buf), 0);
207 ok(ret == EINVAL, "Expected strerror_s to return EINVAL, got %d\n", ret);
208 ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno);
209
210 memset(buf, 'X', sizeof(buf));
211 errno = EBADF;
212 ret = pstrerror_s(buf, 0, 0);
213 ok(ret == EINVAL, "Expected strerror_s to return EINVAL, got %d\n", ret);
214 ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno);
215 ok(buf[0] == 'X', "Expected output buffer to be untouched\n");
216
217 memset(buf, 'X', sizeof(buf));
218 ret = pstrerror_s(buf, 1, 0);
219 ok(ret == 0, "Expected strerror_s to return 0, got %d\n", ret);
220 ok(buf[0] == 0, "Expected output buffer to be null terminated\n");
221
222 memset(buf, 'X', sizeof(buf));
223 ret = pstrerror_s(buf, 2, 0);
224 ok(ret == 0, "Expected strerror_s to return 0, got %d\n", ret);
225 ok(strlen(buf) == 1, "Expected output buffer to be truncated\n");
226
227 memset(buf, 'X', sizeof(buf));
228 ret = pstrerror_s(buf, sizeof(buf), 0);
229 ok(ret == 0, "Expected strerror_s to return 0, got %d\n", ret);
230
231 memset(buf, 'X', sizeof(buf));
232 ret = pstrerror_s(buf, sizeof(buf), -1);
233 ok(ret == 0, "Expected strerror_s to return 0, got %d\n", ret);
234}
235
236static void test__get_doserrno(void)
237{
238 int ret, out;
239
240 if (!p_get_doserrno)
241 {
242 win_skip("_get_doserrno is not available\n");
243 return;
244 }
245
247 errno = EBADF;
248 ret = p_get_doserrno(NULL);
249 ok(ret == EINVAL, "Expected _get_doserrno to return EINVAL, got %d\n", ret);
250 ok(_doserrno == ERROR_INVALID_CMM, "Expected _doserrno to be ERROR_INVALID_CMM, got %ld\n", _doserrno);
251 ok(errno == EBADF, "Expected errno to be EBADF, got %d\n", errno);
252
254 errno = EBADF;
255 out = 0xdeadbeef;
256 ret = p_get_doserrno(&out);
257 ok(ret == 0, "Expected _get_doserrno to return 0, got %d\n", ret);
258 ok(out == ERROR_INVALID_CMM, "Expected output variable to be ERROR_INVALID_CMM, got %d\n", out);
259}
260
261static void test__get_errno(void)
262{
263 int ret, out;
264
265 if (!p_get_errno)
266 {
267 win_skip("_get_errno is not available\n");
268 return;
269 }
270
271 errno = EBADF;
272 ret = p_get_errno(NULL);
273 ok(ret == EINVAL, "Expected _get_errno to return EINVAL, got %d\n", ret);
274 ok(errno == EBADF, "Expected errno to be EBADF, got %d\n", errno);
275
276 errno = EBADF;
277 out = 0xdeadbeef;
278 ret = p_get_errno(&out);
279 ok(ret == 0, "Expected _get_errno to return 0, got %d\n", ret);
280 ok(out == EBADF, "Expected output variable to be EBADF, got %d\n", out);
281}
282
283static void test__set_doserrno(void)
284{
285 int ret;
286
287 if (!p_set_doserrno)
288 {
289 win_skip("_set_doserrno is not available\n");
290 return;
291 }
292
294 ret = p_set_doserrno(ERROR_FILE_NOT_FOUND);
295 ok(ret == 0, "Expected _set_doserrno to return 0, got %d\n", ret);
297 "Expected _doserrno to be ERROR_FILE_NOT_FOUND, got %ld\n", _doserrno);
298
300 ret = p_set_doserrno(-1);
301 ok(ret == 0, "Expected _set_doserrno to return 0, got %d\n", ret);
302 ok(_doserrno == -1,
303 "Expected _doserrno to be -1, got %ld\n", _doserrno);
304
306 ret = p_set_doserrno(0xdeadbeef);
307 ok(ret == 0, "Expected _set_doserrno to return 0, got %d\n", ret);
308 ok(_doserrno == 0xdeadbeef,
309 "Expected _doserrno to be 0xdeadbeef, got %ld\n", _doserrno);
310}
311
312static void test__set_errno(void)
313{
314 int ret;
315
316 if (!p_set_errno)
317 {
318 win_skip("_set_errno is not available\n");
319 return;
320 }
321
322 errno = EBADF;
323 ret = p_set_errno(EINVAL);
324 ok(ret == 0, "Expected _set_errno to return 0, got %d\n", ret);
325 ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno);
326
327 errno = EBADF;
328 ret = p_set_errno(-1);
329 ok(ret == 0, "Expected _set_errno to return 0, got %d\n", ret);
330 ok(errno == -1, "Expected errno to be -1, got %d\n", errno);
331
332 errno = EBADF;
333 ret = p_set_errno(0xdeadbeef);
334 ok(ret == 0, "Expected _set_errno to return 0, got %d\n", ret);
335 ok(errno == 0xdeadbeef, "Expected errno to be 0xdeadbeef, got %d\n", errno);
336}
337
338static void test__popen_child(int fd)
339{
340 /* don't execute any tests here */
341 /* ExitProcess is used to set return code of _pclose */
342 printf("child output\n");
344 ExitProcess(1);
345 ExitProcess(0x37);
346}
347
348static void test__popen_read_child(void)
349{
350 char buf[1024], *rets;
351
352 rets = fgets(buf, sizeof(buf), stdin);
353 if (strcmp(buf, "child-to-parent\n") != 0)
354 ExitProcess(1);
355
356 rets = fgets(buf, sizeof(buf), stdin);
357 if (rets)
358 ExitProcess(2);
359 ExitProcess(3);
360}
361
362static void test__popen(const char *name)
363{
364 FILE *pipe;
365 char *tempf, buf[1024];
366 int ret, fd;
367
368 tempf = _tempnam(".", "wne");
369 ok(tempf != NULL, "_tempnam failed\n");
370 fd = _open(tempf, _O_CREAT | _O_WRONLY);
371 ok(fd != -1, "open failed\n");
372
373 sprintf(buf, "\"%s\" misc popen %d", name, fd);
374 pipe = _popen(buf, "r");
375 ok(pipe != NULL, "_popen failed with error: %d\n", errno);
376
377 fgets(buf, sizeof(buf), pipe);
378 ok(!strcmp(buf, "child output\n"), "buf = %s\n", buf);
379
380 ret = _pclose(pipe);
381 ok(ret == 0x37, "_pclose returned %x, expected 0x37\n", ret);
382 _close(fd);
383 _unlink(tempf);
384 free(tempf);
385
386 errno = 0xdeadbeef;
387 ret = _pclose((FILE*)0xdeadbeef);
388 ok(ret == -1, "_pclose returned %x, expected -1\n", ret);
389 if(p_set_errno)
390 ok(errno == EBADF, "errno = %d\n", errno);
391
392 sprintf(buf, "\"%s\" misc popen_read", name);
393 pipe = _popen(buf, "w");
394 ok(pipe != NULL, "_popen failed with error: %d\n", errno);
395
396 ret = fputs("child-to-parent\n", pipe);
397 ok(ret != EOF, "fputs returned %x\n", ret);
398
399#ifdef __REACTOS__
400 if (IsReactOS())
401 {
402 skip("Skipping _pclose, because it hangs on reactos\n");
403 return;
404 }
405#endif
406 ret = _pclose(pipe);
407 ok(ret == 0x3, "_pclose returned %x, expected 0x3\n", ret);
408}
409
410static void test__invalid_parameter(void)
411{
412 if(!p__invalid_parameter) {
413 win_skip("_invalid_parameter not available\n");
414 return;
415 }
416
417 p__invalid_parameter(NULL, NULL, NULL, 0, 0);
418}
419
421{
422 int pos;
423 int *base;
424
425 struct {
426 int l;
427 int r;
428 } cmp[64];
429};
430
431static int __cdecl qsort_comp(void *ctx, const void *l, const void *r)
432{
433 struct qsort_test *qt = ctx;
434
435 if(qt) {
436 ok(qt->pos < 64, "qt->pos = %d\n", qt->pos);
437 ok(qt->cmp[qt->pos].l == (int*)l-qt->base,
438 "%d) l on %ld position\n", qt->pos, (long)((int*)l - qt->base));
439 ok(qt->cmp[qt->pos].r == (int*)r-qt->base,
440 "%d) r on %ld position\n", qt->pos, (long)((int*)r - qt->base));
441 qt->pos++;
442 }
443
444 return *(int*)l%1000 - *(int*)r%1000;
445}
446
447static void test_qsort_s(void)
448{
449 static const int nonstable_test[] = {9000, 8001, 7002, 6003, 1003, 5004, 4005, 3006, 2007};
450 int tab[100], i;
451
452 struct qsort_test small_sort = {
453 0, tab, {
454 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4}, {6, 5}, {7, 6},
455 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4}, {6, 5},
456 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4},
457 {1, 0}, {2, 1}, {3, 2}, {4, 3},
458 {1, 0}, {2, 1}, {3, 2},
459 {1, 0}, {2, 1},
460 {1, 0}
461 }
462 }, small_sort2 = {
463 0, tab, {
464 {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0},
465 {1, 0}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1},
466 {1, 0}, {2, 1}, {3, 2}, {4, 2}, {5, 2},
467 {1, 0}, {2, 1}, {3, 2}, {4, 3},
468 {1, 0}, {2, 1}, {3, 2},
469 {1, 0}, {2, 1},
470 {1, 0}
471 }
472 }, quick_sort = {
473 0, tab, {
474 {0, 4}, {0, 8}, {4, 8},
475 {1, 4}, {2, 4}, {3, 4}, {5, 4}, {6, 4}, {7, 4}, {7, 4}, {6, 4},
476 {6, 4},
477 {8, 7},
478 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4}, {6, 4},
479 {1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 3},
480 {1, 0}, {2, 1}, {3, 2}, {4, 2},
481 {1, 0}, {2, 1}, {3, 2},
482 {1, 0}, {2, 1},
483 {1, 0}
484 }
485 };
486
487 if(!p_qsort_s) {
488 win_skip("qsort_s not available\n");
489 return;
490 }
491
492 for(i=0; i<8; i++) tab[i] = i;
493 p_qsort_s(tab, 8, sizeof(int), qsort_comp, &small_sort);
494 ok(small_sort.pos == 28, "small_sort.pos = %d\n", small_sort.pos);
495 for(i=0; i<8; i++)
496 ok(tab[i] == i, "tab[%d] = %d\n", i, tab[i]);
497
498 for(i=0; i<8; i++) tab[i] = 7-i;
499 p_qsort_s(tab, 8, sizeof(int), qsort_comp, &small_sort2);
500 ok(small_sort2.pos == 28, "small_sort2.pos = %d\n", small_sort2.pos);
501 for(i=0; i<8; i++)
502 ok(tab[i] == i, "tab[%d] = %d\n", i, tab[i]);
503
504 for(i=0; i<9; i++) tab[i] = i;
505 tab[5] = 1;
506 tab[6] = 2;
507 p_qsort_s(tab, 9, sizeof(int), qsort_comp, &quick_sort);
508 ok(quick_sort.pos == 34, "quick_sort.pos = %d\n", quick_sort.pos);
509
510 /* show that qsort is not stable */
511 for(i=0; i<9; i++) tab[i] = 8-i + 1000*(i+1);
512 tab[0] = 1003;
513 p_qsort_s(tab, 9, sizeof(int), qsort_comp, NULL);
514 for(i=0; i<9; i++)
515 ok(tab[i] == nonstable_test[i], "tab[%d] = %d, expected %d\n", i, tab[i], nonstable_test[i]);
516
517 /* check if random data is sorted */
518 srand(0);
519 for(i=0; i<100; i++) tab[i] = rand()%1000;
520 p_qsort_s(tab, 100, sizeof(int), qsort_comp, NULL);
521 for(i=1; i<100; i++)
522 ok(tab[i-1] <= tab[i], "data sorted incorrectly on position %d: %d <= %d\n", i, tab[i-1], tab[i]);
523
524 /* test if random permutation is sorted correctly */
525 for(i=0; i<100; i++) tab[i] = i;
526 for(i=0; i<100; i++) {
527 int b = rand()%100;
528 int e = rand()%100;
529
530 if(b == e) continue;
531 tab[b] ^= tab[e];
532 tab[e] ^= tab[b];
533 tab[b] ^= tab[e];
534 }
535 p_qsort_s(tab, 100, sizeof(int), qsort_comp, NULL);
536 for(i=0; i<100; i++)
537 ok(tab[i] == i, "data sorted incorrectly on position %d: %d\n", i, tab[i]);
538}
539
540static int eq_nan(UINT64 ai, double b)
541{
542 UINT64 bi = *(UINT64*)&b;
543 UINT64 mask;
544
545#if defined(__i386__)
546 mask = 0xFFFFFFFF00000000ULL;
547#else
548 mask = ~0;
549#endif
550
551 ok((ai & mask) == (bi & mask), "comparing %s and %s\n",
553 return (ai & mask) == (bi & mask);
554}
555
556static int eq_nanf(DWORD ai, float b)
557{
558 DWORD bi = *(DWORD*)&b;
559 ok(ai == bi, "comparing %08lx and %08lx\n", ai, bi);
560 return ai == bi;
561}
562
563static void test_math_functions(void)
564{
565 static const UINT64 test_nan_i = 0xFFF0000123456780ULL;
566 static const DWORD test_nanf_i = 0xFF801234;
567 double test_nan = *(double*)&test_nan_i;
568 float test_nanf = *(float*)&test_nanf_i;
569 double ret;
570
571 errno = 0xdeadbeef;
572 p_atan(NAN);
573 ok(errno == EDOM, "errno = %d\n", errno);
574
575 errno = 0xdeadbeef;
576 ret = p_atan(INFINITY);
577 ok(almost_equal(ret, 1.57079632679489661923), "ret = %lf\n", ret);
578 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
579
580 errno = 0xdeadbeef;
581 ret = p_atan(-INFINITY);
582 ok(almost_equal(ret, -1.57079632679489661923), "ret = %lf\n", ret);
583 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
584
585 errno = 0xdeadbeef;
586 p_tanh(NAN);
587 ok(errno == EDOM, "errno = %d\n", errno);
588
589 errno = 0xdeadbeef;
590 ret = p_tanh(INFINITY);
591 ok(almost_equal(ret, 1.0), "ret = %lf\n", ret);
592 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
593
594 errno = 0xdeadbeef;
595 p_exp(NAN);
596 ok(errno == EDOM, "errno = %d\n", errno);
597
598 errno = 0xdeadbeef;
599 p_exp(INFINITY);
600 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
601
602 ok(eq_nan(test_nan_i | (1ULL << 51), cosh(test_nan)), "cosh not preserving nan\n");
603 ok(eq_nan(test_nan_i | (1ULL << 51), sinh(test_nan)), "sinh not preserving nan\n");
604 ok(eq_nan(test_nan_i | (1ULL << 51), tanh(test_nan)), "tanh not preserving nan\n");
605 ok(eq_nanf(test_nanf_i | (1 << 22), coshf(test_nanf)), "coshf not preserving nan\n");
606 ok(eq_nanf(test_nanf_i | (1 << 22), sinhf(test_nanf)), "sinhf not preserving nan\n");
607 ok(eq_nanf(test_nanf_i | (1 << 22), tanhf(test_nanf)), "tanhf not preserving nan\n");
608}
609
610static void __cdecl test_thread_func(void *end_thread_type)
611{
612 if (end_thread_type == (void*)1)
613 _endthread();
614 else if (end_thread_type == (void*)2)
615 ExitThread(0);
616 else if (end_thread_type == (void*)3)
617 _endthreadex(0);
618}
619
620static unsigned __stdcall test_thread_func_ex(void *arg)
621{
622 _endthread();
623 return 0;
624}
625
627{
629 DWORD ret;
630
631 /* _beginthread: handle is not closed on ExitThread and _endthreadex */
633 ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
636 ok(!ret, "ret = %ld\n", ret);
637
639 ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
642 ok(!ret, "ret = %ld\n", ret);
643
645 ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
646 Sleep(150);
648 ok(ret == WAIT_OBJECT_0, "ret = %ld\n", ret);
650 ok(ret, "ret = %ld\n", ret);
651
653 ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
654 Sleep(150);
656 ok(ret == WAIT_OBJECT_0, "ret = %ld\n", ret);
658 ok(ret, "ret = %ld\n", ret);
659
660 /* _beginthreadex: handle is not closed on _endthread */
662 ok(hThread != NULL, "_beginthreadex failed (%d)\n", errno);
663 Sleep(150);
665 ok(ret == WAIT_OBJECT_0, "ret = %ld\n", ret);
667 ok(ret, "ret = %ld\n", ret);
668}
669
670static void test_thread_suspended(void)
671{
673 DWORD ret;
674
676 ok(hThread != NULL, "_beginthreadex failed (%d)\n", errno);
678 ok(ret == 1, "suspend count = %ld\n", ret);
680 ok(ret == WAIT_OBJECT_0, "ret = %ld\n", ret);
681}
682
683static int __cdecl _lfind_s_comp(void *ctx, const void *l, const void *r)
684{
685 *(int *)ctx = 0xdeadc0de;
686 return *(int *)l - *(int *)r;
687}
688
689static void test__lfind_s(void)
690{
691 static const int tests[] = {9000, 8001, 7002, 6003, 1003, 5004, 4005, 3006, 2007};
692 unsigned int num;
693 void *found;
694 int ctx;
695 int key;
696
697 if (!p_lfind_s)
698 {
699 win_skip("_lfind_s is not available\n");
700 return;
701 }
702
703 key = 1234;
705
706 errno = 0xdeadbeef;
707 found = p_lfind_s(NULL, tests, &num, sizeof(int), _lfind_s_comp, NULL);
708 ok(errno == EINVAL, "errno = %d\n", errno);
709 ok(!found, "Expected NULL, got %p\n", found);
710
711 errno = 0xdeadbeef;
712 found = p_lfind_s(&key, NULL, &num, sizeof(int), _lfind_s_comp, NULL);
713 ok(errno == EINVAL, "errno = %d\n", errno);
714 ok(!found, "Expected NULL, got %p\n", found);
715
716 errno = 0xdeadbeef;
717 found = p_lfind_s(&key, tests, &num, 0, _lfind_s_comp, NULL);
718 ok(errno == EINVAL, "errno = %d\n", errno);
719 ok(!found, "Expected NULL, got %p\n", found);
720
721 errno = 0xdeadbeef;
722 found = p_lfind_s(&key, tests, &num, sizeof(int), NULL, NULL);
723 ok(errno == EINVAL, "errno = %d\n", errno);
724 ok(!found, "Expected NULL, got %p\n", found);
725
726 ctx = -1;
727 key = 9000;
728 errno = 0xdeadbeef;
729 found = p_lfind_s(&key, tests, &num, sizeof(int), _lfind_s_comp, &ctx);
730 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
731 ok(found == tests, "Expected %p, got %p\n", tests, found);
732 ok(ctx == 0xdeadc0de, "Expected 0xdeadc0de, got %x\n", ctx);
733
734 ctx = -1;
735 key = 2007;
736 errno = 0xdeadbeef;
737 found = p_lfind_s(&key, tests, &num, sizeof(int), _lfind_s_comp, &ctx);
738 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
739 ok(found == tests+8, "Expected %p, got %p\n", tests+8, found);
740 ok(ctx == 0xdeadc0de, "Expected 0xdeadc0de, got %x\n", ctx);
741
742 ctx = -1;
743 key = 1234;
744 errno = 0xdeadbeef;
745 found = p_lfind_s(&key, tests, &num, sizeof(int), _lfind_s_comp, &ctx);
746 ok(errno == 0xdeadbeef, "errno = %d\n", errno);
747 ok(!found, "Expected NULL, got %p\n", found);
748 ok(ctx == 0xdeadc0de, "Expected 0xdeadc0de, got %x\n", ctx);
749}
750
752{
753 int arg_c;
754 char** arg_v;
755
756 init();
757
758 arg_c = winetest_get_mainargs(&arg_v);
759 if(arg_c >= 3) {
760 if (!strcmp(arg_v[2], "popen_read"))
762 else if(arg_c == 4 && !strcmp(arg_v[2], "popen"))
763 test__popen_child(atoi(arg_v[3]));
764 else
765 ok(0, "invalid argument '%s'\n", arg_v[2]);
766
767 return;
768 }
769
770 test_rand_s();
777 test__popen(arg_v[0]);
779 test_qsort_s();
784}
unsigned long long UINT64
_STLP_DECLSPEC complex< float > _STLP_CALL sinh(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL cosh(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL tanh(const complex< float > &)
#define EINVAL
Definition: acclib.h:90
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define EBADF
Definition: acclib.h:82
#define __cdecl
Definition: accygwin.h:79
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ARRAY_SIZE(A)
Definition: main.h:20
r l[0]
Definition: byte_order.h:168
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define _O_CREAT
Definition: cabinet.h:46
#define _O_WRONLY
Definition: cabinet.h:38
#define CloseHandle
Definition: compat.h:739
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:365
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define EDOM
Definition: errno.h:39
__kernel_size_t size_t
Definition: linux.h:237
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:97
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
GLenum GLint GLuint mask
Definition: glext.h:6028
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLuint GLuint num
Definition: glext.h:9618
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_Check_return_ float __cdecl tanhf(_In_ float x)
Definition: math.h:251
#define INFINITY
Definition: math.h:56
_Check_return_ float __cdecl coshf(_In_ float x)
Definition: math.h:239
_Check_return_ float __cdecl sinhf(_In_ float x)
Definition: math.h:248
_Check_return_opt_ _CRTIMP int __cdecl _pclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP char *__cdecl _tempnam(_In_opt_z_ const char *_DirName, _In_opt_z_ const char *_FilePrefix)
#define EOF
Definition: stdio.h:24
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
#define stdin
Definition: stdio.h:98
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl _popen(_In_z_ const char *_Command, _In_z_ const char *_Mode)
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define _doserrno
Definition: stdlib.h:131
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
#define d
Definition: ke_i.h:81
#define e
Definition: ke_i.h:82
#define b
Definition: ke_i.h:79
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static struct test_info tests[]
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:143
#define NAN
Definition: mesh.c:39
#define todo_wine_if(is_todo)
Definition: custom.c:86
static void test__invalid_parameter(void)
Definition: misc.c:410
static void test__lfind_s(void)
Definition: misc.c:689
struct _I10_OUTPUT_data I10_OUTPUT_data
static void test__set_doserrno(void)
Definition: misc.c:283
static void test__popen_child(int fd)
Definition: misc.c:338
static void test_math_functions(void)
Definition: misc.c:563
static const I10_OUTPUT_test I10_OUTPUT_tests[]
Definition: misc.c:114
static void __cdecl test_thread_func(void *end_thread_type)
Definition: misc.c:610
static int eq_nan(UINT64 ai, double b)
Definition: misc.c:540
static void test__popen_read_child(void)
Definition: misc.c:348
static void test_qsort_s(void)
Definition: misc.c:447
static void test__get_errno(void)
Definition: misc.c:261
static unsigned __stdcall test_thread_func_ex(void *arg)
Definition: misc.c:620
static void test_thread_handle_close(void)
Definition: misc.c:626
struct _I10_OUTPUT_test I10_OUTPUT_test
static void test__set_errno(void)
Definition: misc.c:312
static void test__get_doserrno(void)
Definition: misc.c:236
static void test_I10_OUTPUT(void)
Definition: misc.c:159
static int __cdecl _lfind_s_comp(void *ctx, const void *l, const void *r)
Definition: misc.c:683
static void test_strerror_s(void)
Definition: misc.c:189
static BOOL almost_equal(double d1, double d2)
Definition: misc.c:32
static int __cdecl qsort_comp(void *ctx, const void *l, const void *r)
Definition: misc.c:431
static int eq_nanf(DWORD ai, float b)
Definition: misc.c:556
static void test__popen(const char *name)
Definition: misc.c:362
static void test_rand_s(void)
Definition: misc.c:77
static const wchar_t const wchar_t unsigned uintptr_t
Definition: misc.c:49
static void test_thread_suspended(void)
Definition: misc.c:670
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:91
HANDLE hThread
Definition: wizard.c:28
#define errno
Definition: errno.h:18
_CRTIMP intptr_t __cdecl _get_osfhandle(_In_ int _FileHandle)
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
_Check_return_ _CRTIMP int __cdecl _unlink(_In_z_ const char *_Filename)
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
Definition: file.c:2001
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
_CRTIMP uintptr_t __cdecl _beginthread(_In_ void(__cdecl *_StartAddress)(void *), _In_ unsigned _StackSize, _In_opt_ void *_ArgList)
#define win_skip
Definition: test.h:164
int winetest_get_mainargs(char ***pargv)
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
char sign
Definition: misc.c:99
short pos
Definition: misc.c:98
char str[100]
Definition: misc.c:101
I10_OUTPUT_data out
Definition: misc.c:109
const char * remain
Definition: misc.c:111
struct uld d
Definition: misc.c:105
Definition: copy.c:22
Definition: name.c:39
int pos
Definition: misc.c:422
int l
Definition: misc.c:426
struct qsort_test::@1756 cmp[64]
int * base
Definition: misc.c:423
int r
Definition: misc.c:427
Definition: misc.c:39
ULONG exp
Definition: misc.c:39
ULONG lo
Definition: misc.c:39
ULONG hi
Definition: misc.c:39
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
void CDECL _endthread(void)
Definition: thread.c:95
void CDECL _endthreadex(unsigned int)
Definition: thread.cpp:276
PVOID HANDLE
Definition: typedefs.h:73
#define __stdcall
Definition: typedefs.h:25
uint32_t ULONG
Definition: typedefs.h:59
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
int ret
static struct wctab tab[]
#define CREATE_SUSPENDED
Definition: winbase.h:188
#define WAIT_OBJECT_0
Definition: winbase.h:439
#define ERROR_INVALID_CMM
Definition: winerror.h:1185
static int init
Definition: wintirpc.c:33
unsigned char BYTE
Definition: xxhash.c:193