| 1 |
#include <assert.h> |
| 2 |
#include <windows.h> |
| 3 |
|
| 4 |
int main(int argc, char *argv[]) |
| 5 |
{ |
| 6 |
// verify that the expected resource exists and has the expected contents |
| 7 |
HRSRC hRsrc; |
| 8 |
unsigned int size; |
| 9 |
HGLOBAL hGlobal; |
| 10 |
void* data; |
| 11 |
|
| 12 |
((void)argc); |
| 13 |
|
| 14 |
hRsrc = FindResource(NULL, argv[1], RT_RCDATA); |
| 15 |
assert(hRsrc); |
| 16 |
|
| 17 |
size = SizeofResource(NULL, hRsrc); |
| 18 |
hGlobal = LoadResource(NULL, hRsrc); |
| 19 |
data = LockResource(hGlobal); |
| 20 |
|
| 21 |
assert(size == strlen(argv[1])); |
| 22 |
assert(memcmp(data, argv[1], size) == 0); |
| 23 |
|
| 24 |
return 0; |
| 25 |
} |