Mail Archives: djgpp/1996/10/22/18:11:58
> Inside this structure there is a pointer called "OemStringPtr" defined
> in the struct statement as:
> char *OemStringPtr PACKED;
> If I try to print this pointer to a null terminated string, using the
> following line:
> printf("%s", vesastruct->OemStringPtr);
> I get the following error:
> Exiting due to signal SIGSEGV
> ...
> The specs say that OemStringPtr is a real mode far pointer in
> protected mode. How do I access it?
> Please help. I have been trying to figure this out for a while now.
You could always do something like:
char oem_string[256];
unsigned int oem_str_ptr;
char letter;
int i;
oem_str_ptr = (unsigned int) vesastruct->OemStringPtr;
oem_str_ptr = (((oem_str_ptr & 0xFFFF0000) >> 12) |
(oem_str_ptr & 0xFFFF));
i = 0;
do
{
letter = (char) farnspeekb(oem_str_ptr);
oem_string[i] = letter;
i++;
} while ((i < 256) | (i != '\0'));
printf("%s\n",oem_string);
Its kludgy, but I have never worried about the oem string before, and
right now I am very bored... :)
Leathal.
- Raw text -