VirtualBox

source: kStuff/trunk/kLdr/testcase/tst-0-driver.c@ 2

Last change on this file since 2 was 2, checked in by bird, 17 years ago

Imported http://svn.netlabs.org/repos/libc/trunk/kStuff, revision 3612.

  • Property svn:keywords set to Id Revision
File size: 20.9 KB
Line 
1/* $Id: tst-0-driver.c 2 2007-11-16 16:07:14Z bird $ */
2/** @file
3 * kLdr - Dynamic Loader testcase no. 0, Driver.
4 */
5
6/*
7 * Copyright (c) 2006-2007 knut st. osmundsen <[email protected]>
8 *
9 * This file is part of kStuff.
10 *
11 * kStuff is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * kStuff is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with kStuff; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 *
25 */
26
27/*******************************************************************************
28* Header Files *
29*******************************************************************************/
30#include "tst.h"
31#include <stdarg.h>
32#include <stdio.h>
33#include <stdlib.h>
34#include <string.h>
35
36
37/*******************************************************************************
38* Defined Constants And Macros *
39*******************************************************************************/
40/** Select the appropriate KLDRSYMKIND bit define. */
41#define MY_KLDRSYMKIND_BITS ( sizeof(void *) == 4 ? KLDRSYMKIND_32BIT : KLDRSYMKIND_64BIT )
42
43
44/*******************************************************************************
45* Global Variables *
46*******************************************************************************/
47/** The numbers of errors. */
48static int g_cErrors = 0;
49
50
51
52/**
53 * Report failure.
54 */
55static int Failure(const char *pszFormat, ...)
56{
57 va_list va;
58
59 g_cErrors++;
60
61 printf("tst-0-driver: ");
62 va_start(va, pszFormat);
63 vprintf(pszFormat, va);
64 va_end(va);
65 printf("\n");
66 return 1;
67}
68
69
70int main(int argc, char **argv)
71{
72 const char *pszErrInit = "Error, szErr wasn't zapped";
73 char szErr[512];
74 char szBuf[512];
75 char *psz;
76 KSIZE cch;
77 HKLDRMOD hMod;
78 int rc;
79
80 /*
81 * The first thing to do is a simple load / unload test
82 * using the tst-0-a library (it'll drag in tst-0-d).
83 */
84 printf("tst-0-driver: Basic API test using 'tst-0-a'...\n");
85 hMod = (HKLDRMOD)0xffffeeee;
86 strcpy(szErr, pszErrInit);
87 rc = kLdrDyldLoad("tst-0-a", NULL, NULL, KLDRDYLD_SEARCH_HOST,
88 KLDRDYLD_LOAD_FLAGS_RECURSIVE_INIT, &hMod, szErr, sizeof(szErr));
89 if (rc)
90 Failure("kLdrDyldLoad(\"tst-0\",...) failed, rc=%d (%#x). szErr='%s'.\n", rc, rc, szErr);
91 if (!strcmp(szErr, pszErrInit))
92 Failure("szErr wasn't set.\n");
93 if (hMod == (HKLDRMOD)0xffffeeee)
94 Failure("hMod wasn't set.\n");
95 if (hMod == NIL_HKLDRMOD && !rc)
96 Failure("rc=0 but hMod=NIL_HKLDRMOD\n");
97 if (!rc)
98 {
99 HKLDRMOD hMod2;
100 HKLDRMOD hMod3;
101 printf("tst-0-driver: hMod=%p ('tst-0-a')\n", (void *)hMod);
102
103 /*
104 * Simple test of kLdrDyldFindByName.
105 */
106 hMod2 = (HKLDRMOD)0xffffeeee;
107 rc = kLdrDyldFindByName("tst-0", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod2);
108 if (!rc)
109 Failure("kLdrDyldFindByName(\"tst-0\",,,) didn't fail!\n");
110 if (rc && hMod2 != NIL_HKLDRMOD)
111 Failure("hMod2 wasn't set correctly on kLdrDyldFindByName failure!\n");
112
113 hMod2 = (HKLDRMOD)0xffffeeee;
114 rc = kLdrDyldFindByName("tst-0-a", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod2);
115 if (rc)
116 Failure("kLdrDyldFindByName(\"tst-0-a\",,,) failed, rc=%d (%#x)\n", rc, rc);
117 if (!rc && hMod2 != hMod)
118 Failure("kLdrDyldFindByName(\"tst-0-a\",,,) returned the wrong module handle: %p instead of %p\n",
119 (void *)hMod2, (void *)hMod);
120
121 hMod2 = (HKLDRMOD)0xffffeeee;
122 rc = kLdrDyldFindByName("tst-0-d", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod2);
123 if (!rc)
124 printf("tst-0-driver: hMod2=%p ('tst-0-d')\n", (void *)hMod2);
125 else
126 Failure("kLdrDyldFindByName(\"tst-0-d\",,,) failed, rc=%d (%#x)\n", rc, rc);
127
128 /*
129 * Get the name and filename for each of the two modules.
130 */
131 rc = kLdrDyldGetName(hMod2, szBuf, sizeof(szBuf));
132 if (!rc)
133 {
134 printf("tst-0-driver: name: '%s' ('tst-0-d')\n", szBuf);
135 psz = strstr(szBuf, "-0-");
136 if ( !psz
137 || strnicmp(psz, "-0-d", sizeof("-0-d") - 1))
138 Failure("kLdrDyldGetName(\"tst-0-d\",,,) -> '%s': pattern '-0-d' not found\n", szBuf);
139
140 /* overflow test. */
141 cch = strlen(szBuf);
142 szBuf[cch + 1] = szBuf[cch] = szBuf[cch - 1] = 'x';
143 szBuf[cch + 2] = '\0';
144 rc = kLdrDyldGetName(hMod2, szBuf, cch);
145 if (rc == KERR_BUFFER_OVERFLOW)
146 {
147 if (!szBuf[0])
148 Failure("kLdrDyldGetName didn't return partial result on overflow\n");
149 else if (szBuf[cch - 1])
150 Failure("kLdrDyldGetName didn't terminate partial result correctly overflow: '%s'\n", szBuf);
151 else if (szBuf[cch] != 'x')
152 Failure("kLdrDyldGetName exceeded the buffer limit on partial overflow: '%s'\n", szBuf);
153 }
154 else
155 Failure("kLdrDyldGetName(\"tst-0-d\",,,) -> rc=%d (%#x) instead of KERR_BUFFER_OVERFLOW\n", rc, rc);
156
157 /* check that we can query the module by the returned name. */
158 rc = kLdrDyldGetName(hMod2, szBuf, sizeof(szBuf));
159 if (!rc)
160 {
161 hMod3 = (HKLDRMOD)0xffffeeee;
162 rc = kLdrDyldFindByName(szBuf, NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod3);
163 if (rc || hMod3 != hMod2)
164 Failure("kLdrDyldFindByName(\"%s\",,,) failed, rc=%d (%#x) hMod3=%p hMod2=%p\n",
165 szBuf, rc, rc, (void *)hMod3, (void *)hMod2);
166 }
167 else
168 Failure("kLdrDyldGetName(\"tst-0-d\",,,) failed (b), rc=%d (%#x)\n", rc, rc);
169 }
170 else
171 Failure("kLdrDyldGetName(\"tst-0-d\",,,) failed, rc=%d (%#x)\n", rc, rc);
172
173 rc = kLdrDyldGetFilename(hMod2, szBuf, sizeof(szBuf));
174 if (!rc)
175 {
176 printf("tst-0-driver: filename: '%s' ('tst-0-d')\n", szBuf);
177
178 /* overflow test. */
179 cch = strlen(szBuf);
180 szBuf[cch + 1] = szBuf[cch] = szBuf[cch - 1] = 'x';
181 szBuf[cch + 2] = '\0';
182 rc = kLdrDyldGetFilename(hMod2, szBuf, cch);
183 if (rc == KERR_BUFFER_OVERFLOW)
184 {
185 if (!szBuf[0])
186 Failure("kLdrDyldGetFilename didn't return partial result on overflow\n");
187 else if (szBuf[cch - 1])
188 Failure("kLdrDyldGetFilename didn't terminate partial result correctly overflow: '%s'\n", szBuf);
189 else if (szBuf[cch] != 'x')
190 Failure("kLdrDyldGetFilename exceeded the buffer limit on partial overflow: '%s'\n", szBuf);
191 }
192 else
193 Failure("kLdrDyldGetFilename(\"tst-0-d\",,,) -> rc=%d (%#x) instead of KERR_BUFFER_OVERFLOW\n", rc, rc);
194
195 /* check that we can query the module by the returned filename. */
196 rc = kLdrDyldGetFilename(hMod2, szBuf, sizeof(szBuf));
197 if (!rc)
198 {
199 hMod3 = (HKLDRMOD)0xffffeeee;
200 rc = kLdrDyldFindByName(szBuf, NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod3);
201 if (rc || hMod3 != hMod2)
202 Failure("kLdrDyldFindByName(\"%s\",,,) failed, rc=%d (%#x) hMod3=%p hMod2=%p\n",
203 szBuf, rc, rc, (void *)hMod3, (void *)hMod2);
204 }
205 else
206 Failure("kLdrDyldGetName(\"tst-0-d\",,,) failed (b), rc=%d (%#x)\n", rc, rc);
207 }
208 else
209 Failure("kLdrDyldGetFilename(\"tst-0-d\",,,) failed, rc=%d (%#x)\n", rc, rc);
210
211 /* the other module */
212 rc = kLdrDyldGetName(hMod, szBuf, sizeof(szBuf));
213 if (!rc)
214 {
215 printf("tst-0-driver: name: '%s' ('tst-0-a')\n", szBuf);
216 psz = strstr(szBuf, "-0-");
217 if ( !psz
218 || strnicmp(psz, "-0-a", sizeof("-0-a") - 1))
219 Failure("kLdrDyldGetName(\"tst-0-a\",,,) -> '%s': pattern '-0-a' not found\n", szBuf);
220
221 /* check that we can query the module by the returned name. */
222 hMod3 = (HKLDRMOD)0xffffeeee;
223 rc = kLdrDyldFindByName(szBuf, NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod3);
224 if (rc || hMod3 != hMod)
225 Failure("kLdrDyldFindByName(\"%s\",,,) failed, rc=%d (%#x) hMod3=%p hMod=%p\n",
226 szBuf, rc, rc, (void *)hMod3, (void *)hMod);
227 }
228 else
229 Failure("kLdrDyldGetName(\"tst-0-a\",,,) failed, rc=%d (%#x)\n", rc, rc);
230
231 rc = kLdrDyldGetFilename(hMod, szBuf, sizeof(szBuf));
232 if (!rc)
233 {
234 printf("tst-0-driver: filename: '%s' ('tst-0-a')\n", szBuf);
235
236 /* check that we can query the module by the returned filename. */
237 hMod3 = (HKLDRMOD)0xffffeeee;
238 rc = kLdrDyldFindByName(szBuf, NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod3);
239 if (rc || hMod3 != hMod)
240 Failure("kLdrDyldFindByName(\"%s\",,,) failed, rc=%d (%#x) hMod3=%p hMod=%p\n",
241 szBuf, rc, rc, (void *)hMod3, (void *)hMod);
242 }
243 else
244 Failure("kLdrDyldGetFilename(\"tst-0-a\",,,) failed, rc=%d (%#x)\n", rc, rc);
245
246
247 /*
248 * Resolve the symbol exported by each of the two modules and call them.
249 */
250 if (!g_cErrors)
251 {
252 KUPTR uValue;
253 KU32 fKind;
254
255 fKind = 0xffeeffee;
256 uValue = ~(KUPTR)42;
257 rc = kLdrDyldQuerySymbol(hMod, NIL_KLDRMOD_SYM_ORDINAL, MY_NAME("FuncA"), NULL, &uValue, &fKind);
258 if (!rc)
259 {
260 if (uValue == ~(KUPTR)42)
261 Failure("kLdrDyldQuerySymbol(\"tst-0-a\",,\"FuncA\",): uValue wasn't set.\n");
262 if (fKind == 0xffeeffee)
263 Failure("kLdrDyldQuerySymbol(\"tst-0-a\",,\"FuncA\",): fKind wasn't set.\n");
264 if ( (fKind & KLDRSYMKIND_BIT_MASK) != KLDRSYMKIND_NO_BIT
265 && (fKind & KLDRSYMKIND_BIT_MASK) != MY_KLDRSYMKIND_BITS)
266 Failure("fKind=%#x indicates a different code 'bit' mode than we running at.\n", fKind);
267 if ( (fKind & KLDRSYMKIND_TYPE_MASK) != KLDRSYMKIND_NO_TYPE
268 && (fKind & KLDRSYMKIND_TYPE_MASK) != KLDRSYMKIND_CODE)
269 Failure("fKind=%#x indicates that \"FuncA\" isn't code.\n", fKind);
270 if (fKind & KLDRSYMKIND_FORWARDER)
271 Failure("fKind=%#x indicates that \"FuncA\" is a forwarder. it isn't.\n", fKind);
272
273 /* call it. */
274 if (!g_cErrors)
275 {
276 int (*pfnFuncA)(void) = (int (*)(void))uValue;
277 rc = pfnFuncA();
278 if (rc != 0x42000042)
279 Failure("FuncA returned %#x expected 0x42000042\n", rc);
280 }
281
282 /*
283 * Test kLdrDyldFindByAddress now that we've got an address.
284 */
285 hMod3 = (HKLDRMOD)0xeeeeffff;
286 rc = kLdrDyldFindByAddress(uValue, &hMod3, NULL, NULL);
287 if (!rc)
288 {
289 KUPTR offSegment;
290 KU32 iSegment;
291
292 if (hMod3 != hMod)
293 Failure("kLdrDyldFindByAddress(%#p/*FuncA*/, \"tst-0-a\",,,) return incorrect hMod3=%p instead of %p.\n",
294 uValue, hMod3, hMod);
295
296 hMod3 = (HKLDRMOD)0xeeeeffff;
297 iSegment = 0x42424242;
298 rc = kLdrDyldFindByAddress(uValue, &hMod3, &iSegment, &offSegment);
299 if (!rc)
300 {
301 if (hMod3 != hMod)
302 Failure("Bad hMod3 on 2nd kLdrDyldFindByAddress call.\n");
303 if (iSegment > 0x1000) /* safe guess */
304 Failure("Bad iSegment=%#x\n", iSegment);
305 if (offSegment > 0x100000) /* guesswork */
306 Failure("Bad offSegment=%p\n", (void *)offSegment);
307 }
308 else
309 Failure("kLdrDyldFindByAddress(%#p/*FuncA*/, \"tst-0-a\",,,) failed (b), rc=%d (%#x)\n",
310 uValue, rc, rc);
311
312 /* negative test */
313 hMod3 = (HKLDRMOD)0xeeeeffff;
314 iSegment = 0x42424242;
315 offSegment = 0x87654321;
316 rc = kLdrDyldFindByAddress(~(KUPTR)16, &hMod3, &iSegment, &offSegment);
317 if (!rc)
318 Failure("negative kLdrDyldFindByAddress test returned successfully!\n");
319 if (iSegment != ~(KU32)0)
320 Failure("negative kLdrDyldFindByAddress: bad iSegment=%#x\n", iSegment);
321 if (offSegment != ~(KUPTR)0)
322 Failure("negative kLdrDyldFindByAddress: bad offSegment=%p\n", (void *)offSegment);
323 if (hMod3 != NIL_HKLDRMOD)
324 Failure("negative kLdrDyldFindByAddress: bad hMod3=%p\n", (void *)hMod3);
325 }
326 else
327 Failure("kLdrDyldFindByAddress(%#p/*FuncA*/, \"tst-0-a\",,,) failed, rc=%d (%#x)\n",
328 uValue, rc, rc);
329 }
330 else
331 Failure("kLdrDyldQuerySymbol(\"tst-0-a\",,\"FuncA\",) failed, rc=%d (%#x)\n", rc, rc);
332
333 fKind = 0xffeeffee;
334 uValue = ~(KUPTR)42;
335 rc = kLdrDyldQuerySymbol(hMod2, NIL_KLDRMOD_SYM_ORDINAL, MY_NAME("FuncD"), NULL, &uValue, &fKind);
336 if (!rc)
337 {
338 if (uValue == ~(KUPTR)42)
339 Failure("kLdrDyldQuerySymbol(\"tst-0-d\",,\"FuncD\",): uValue wasn't set.\n");
340 if (fKind == 0xffeeffee)
341 Failure("kLdrDyldQuerySymbol(\"tst-0-d\",,\"FuncD\",): fKind wasn't set.\n");
342 if ( (fKind & KLDRSYMKIND_BIT_MASK) != KLDRSYMKIND_NO_BIT
343 && (fKind & KLDRSYMKIND_BIT_MASK) != MY_KLDRSYMKIND_BITS)
344 Failure("fKind=%#x indicates a different code 'bit' mode than we running at.\n", fKind);
345 if ( (fKind & KLDRSYMKIND_TYPE_MASK) != KLDRSYMKIND_NO_TYPE
346 && (fKind & KLDRSYMKIND_TYPE_MASK) != KLDRSYMKIND_CODE)
347 Failure("fKind=%#x indicates that \"FuncD\" isn't code.\n", fKind);
348 if (fKind & KLDRSYMKIND_FORWARDER)
349 Failure("fKind=%#x indicates that \"FuncD\" is a forwarder. it isn't.\n", fKind);
350
351 /* call it. */
352 if (!g_cErrors)
353 {
354 int (*pfnFuncD)(void) = (int (*)(void))uValue;
355 rc = pfnFuncD();
356 if (rc != 0x42000000)
357 Failure("FuncD returned %#x expected 0x42000000\n", rc);
358 }
359
360 /* use the address to get the module handle. */
361 hMod3 = (HKLDRMOD)0xeeeeffff;
362 rc = kLdrDyldFindByAddress(uValue, &hMod3, NULL, NULL);
363 if (!rc)
364 {
365 if (hMod3 != hMod2)
366 Failure("kLdrDyldFindByAddress(%#p/*FuncD*/,,,) return incorrect hMod3=%p instead of %p.\n",
367 uValue, hMod3, hMod2);
368 }
369 else
370 Failure("kLdrDyldFindByAddress(%#p/*FuncD*/,,,) failed, rc=%d (%#x)\n",
371 uValue, rc, rc);
372 }
373 else
374 Failure("kLdrDyldQuerySymbol(\"tst-0-a\",,\"FuncA\",) failed, rc=%d (%#x)\n", rc, rc);
375
376 }
377
378 /*
379 * Finally unload it.
380 */
381 rc = kLdrDyldUnload(hMod);
382 if (rc)
383 Failure("kLdrDyldUnload() failed. rc=%d (%#x)\n", rc, rc);
384 if (!rc)
385 {
386 rc = kLdrDyldFindByName("tst-0-d", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod2);
387 if (rc != KLDR_ERR_MODULE_NOT_FOUND)
388 Failure("kLdrDyldFindByName(\"tst-0-d\",,,) return rc=%d (%#x), expected KLDR_ERR_MODULE_NOT_FOUND\n", rc, rc);
389
390 rc = kLdrDyldFindByName("tst-0-a", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod2);
391 if (rc != KLDR_ERR_MODULE_NOT_FOUND)
392 Failure("kLdrDyldFindByName(\"tst-0-a\",,,) return rc=%d (%#x), expected KLDR_ERR_MODULE_NOT_FOUND\n", rc, rc);
393 }
394 }
395
396 /*
397 * Now do what tst-0 would do; load the three dlls, resolve and call their functions.
398 */
399 if (!g_cErrors)
400 {
401 HKLDRMOD hModA;
402 int (*pfnFuncA)(void);
403 HKLDRMOD hModB;
404 int (*pfnFuncB)(void);
405 HKLDRMOD hModC;
406 int (*pfnFuncC)(void);
407 KUPTR uValue;
408
409 rc = kLdrDyldLoad("tst-0-a", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hModA, NULL, 0);
410 if (rc)
411 Failure("kLdrDyldLoad(\"tst-0-a\",,,,) -> %d (%#x)\n", rc, rc);
412 if (!rc)
413 {
414 rc = kLdrDyldLoad("tst-0-b", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hModB, szErr, sizeof(szErr));
415 if (rc)
416 Failure("kLdrDyldLoad(\"tst-0-b\",,,,) -> %d (%#x) szErr='%s'\n", rc, rc, szErr);
417 }
418 if (!rc)
419 {
420 rc = kLdrDyldLoad("tst-0-c", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hModC, szErr, sizeof(szErr));
421 if (rc)
422 Failure("kLdrDyldLoad(\"tst-0-c\",,,,) -> %d (%#x) szErr='%s'\n", rc, rc, szErr);
423 }
424 if (!rc)
425 {
426 rc = kLdrDyldQuerySymbol(hModA, NIL_KLDRMOD_SYM_ORDINAL, MY_NAME("FuncA"), NULL, &uValue, NULL);
427 if (!rc)
428 pfnFuncA = (int (*)(void))uValue;
429 else
430 Failure("kLdrDyldQuerySymbol(,,\"FuncA\",,) -> %d (%#x)\n", rc, rc);
431 }
432 if (!rc)
433 {
434 rc = kLdrDyldQuerySymbol(hModB, NIL_KLDRMOD_SYM_ORDINAL, MY_NAME("FuncB"), NULL, &uValue, NULL);
435 if (!rc)
436 pfnFuncB = (int (*)(void))uValue;
437 else
438 Failure("kLdrDyldQuerySymbol(,,\"FuncB\",,) -> %d (%#x)\n", rc, rc);
439 }
440 if (!rc)
441 {
442 rc = kLdrDyldQuerySymbol(hModC, NIL_KLDRMOD_SYM_ORDINAL, MY_NAME("FuncC"), NULL, &uValue, NULL);
443 if (!rc)
444 pfnFuncC = (int (*)(void))uValue;
445 else
446 Failure("kLdrDyldQuerySymbol(,,\"FuncA\",,) -> %d (%#x)\n", rc, rc);
447 }
448 if (!rc)
449 {
450 int u = pfnFuncA() | pfnFuncB() | pfnFuncC();
451 if (u == 0x42424242)
452 printf("tst-0-driver: FuncA/B/C => %#x (correct)\n", u);
453 else
454 Failure("FuncA/B/C => %#x\n", u);
455
456 rc = kLdrDyldUnload(hModA);
457 if (rc)
458 Failure("Unload A failed, rc=%d (%#x)\n", rc, rc);
459 u = pfnFuncB() | pfnFuncC();
460 if (u != 0x42424200)
461 Failure("FuncB/C returns %#x instead of 0x42424200 after unloading A\n", u);
462
463 rc = kLdrDyldUnload(hModB);
464 if (rc)
465 Failure("Unload B failed, rc=%d (%#x)\n", rc, rc);
466 u = pfnFuncC();
467 if (u != 0x42420000)
468 Failure("FuncC returns %#x instead of 0x42420000 after unloading A\n", u);
469
470 rc = kLdrDyldUnload(hModC);
471 if (rc)
472 Failure("Unload C failed, rc=%d (%#x)\n", rc, rc);
473
474 rc = kLdrDyldFindByName("tst-0-d", NULL, NULL, KLDRDYLD_SEARCH_HOST, 0, &hMod);
475 if (rc != KLDR_ERR_MODULE_NOT_FOUND)
476 Failure("Query for \"tst-0-d\" after unloading A,B and C returns rc=%d (%#x) instead of KLDR_ERR_MODULE_NOT_FOUND\n",
477 rc, rc);
478 }
479 }
480
481 /*
482 * Now invoke the executable stub which launches the tst-0 program.
483 */
484 if (!g_cErrors)
485 {
486 /// @todo
487 }
488
489 /*
490 * Summary
491 */
492 if (!g_cErrors)
493 printf("tst-0-driver: SUCCESS\n");
494 else
495 printf("tst-0-driver: FAILURE - %d errors\n", g_cErrors);
496 return !!g_cErrors;
497}
498
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette