version 1.4, 2005/02/04 09:30:15
|
version 1.6, 2005/02/11 04:57:17
|
|
|
FDIDestroy | FDIDestroy |
*/ | */ |
| |
/* Currently dummy function pointers */ |
/* Currently mostly dummy function pointers */ |
| |
FNALLOC(dummy_alloc) { |
FNALLOC(debug_alloc) { |
printf("FNALLOC just called with %d\n",cb); | printf("FNALLOC just called with %d\n",cb); |
return 0; |
return malloc(cb); |
} | } |
| |
FNFREE(dummy_free) { |
FNFREE(debug_free) { |
printf("FNFREE just called with %d\n",pv); | printf("FNFREE just called with %d\n",pv); |
|
free(pv); |
return; | return; |
} | } |
| |
|
/* |
|
It is not necessary for these functions to actually call _open etc.; these functions could instead call fopen, fread, fwrite, fclose, and fseek, or CreateFile, ReadFile, WriteFile, CloseHandle, and SetFilePointer, etc. However, the parameters and return codes will have to be translated appropriately (e.g. the file open mode passed in to pfnopen). |
|
*/ |
|
|
FNOPEN(dummy_open) { | FNOPEN(dummy_open) { |
printf("FNOPEN just called with %d, %d, %d\n",pszFile, oflag, pmode); | printf("FNOPEN just called with %d, %d, %d\n",pszFile, oflag, pmode); |
return 0; | return 0; |
} | } |
| |
FNREAD(dummy_read) { | FNREAD(dummy_read) { |
/* printf("FNREAD just called with %d, %d, %d\n",hf, pv, cb); |
printf(" FNREAD just called with %d, %d, %d\n",hf, pv, cb); |
return void; |
return 0; |
*/ return 0; |
|
} | } |
| |
FNWRITE(dummy_write) { | FNWRITE(dummy_write) { |
/* printf("FNWRITE just called with %d, %d, %d\n",hf, pv, cb); |
printf(" FNWRITE just called with %d, %d, %d\n",hf, pv, cb); |
return void; |
return 0; |
*/ return 0; |
|
} | } |
| |
| |
FNCLOSE(dummy_close) { | FNCLOSE(dummy_close) { |
/* printf("FNCLOSE just called with %d\n",hf); |
printf(" FNCLOSE just called with %d\n",hf); |
return void; |
return 0; |
*/ return 0; |
|
} | } |
| |
FNSEEK(dummy_seek) { | FNSEEK(dummy_seek) { |
/* printf("FNSEEK just called with %d, %d, %d\n",hf, dist, seektype); |
printf(" FNSEEK just called with %d, %d, %d\n",hf, dist, seektype); |
return void; |
return 0; |
*/ return 0; |
|
} | } |
| |
HFDI my_hfdi; |
HFDI hfdi_386, hfdi_286, hfdi_unknown; |
/* yes its global and ugly */ | /* yes its global and ugly */ |
| |
static void TestDestroy(void) { | static void TestDestroy(void) { |
|
|
EDIT : Causes GPL if FDIDestroy is called on an invalid pointer. | EDIT : Causes GPL if FDIDestroy is called on an invalid pointer. |
ok( 0 == FDIDestroy(0), "Return true incorrectly in TestDestroy()!\n"); | ok( 0 == FDIDestroy(0), "Return true incorrectly in TestDestroy()!\n"); |
*/ | */ |
ok(FDIDestroy(my_hfdi), "Failed on destroying test hfdi!\n"); |
|
|
ok(FDIDestroy(hfdi_unknown), "FDIDestroy (CPU = unknown) failed!\n"); |
|
printf("Ending TestDestroy()\n"); |
| |
} | } |
| |
|
|
| |
printf("Starting TestCreate()\n"); | printf("Starting TestCreate()\n"); |
| |
my_hfdi = FDICreate( |
hfdi_unknown = FDICreate( |
dummy_alloc, |
debug_alloc, |
dummy_free, |
debug_free, |
dummy_open, | dummy_open, |
dummy_read, | dummy_read, |
dummy_write, | dummy_write, |
dummy_close, | dummy_close, |
dummy_seek, | dummy_seek, |
cpu80386, |
cpuUNKNOWN, |
&error_structure | &error_structure |
); | ); |
|
ok(hfdi_unknown != NULL,"FDICreate (CPU = unknown) failed!\n"); |
|
|
|
|
| |
ok(my_hfdi != NULL,"FDICreate failed!\n"); |
|
| |
printf("Ending TestCreate()\n"); | printf("Ending TestCreate()\n"); |
} | } |