Microsoft KB Archive/50901

From BetaArchive Wiki

C Run-Time Function intdosx() Causes GP Fault

PSS ID Number: Q50901 Article last modified on 11-05-1993

3.00 MS-DOS

The information in this article applies to:
- Microsoft Windows Software Development Kit for Windows version 3.0


My application calls the intdosx() function. Before calling the function, the values necessary for the call are placed in the inregs and segregs structures. When the call is made in 286 and 386 protected mode, a general protection violation occurs; in real mode it works correctly.


You are probably passing an invalid selector in one of the segment registers (segregs). Under protected mode, all of the registers in segregs must be set to valid selectors. Your code should use the segread() function to get the current segment selectors before setting the values necessary for the call. For example: segread(&segregs); // this insures that valid selectors are // passed for the registers you don’t set. … // set applicable inregs and segregs values … intdosx(&inregs, &outregs, &segregs);

Additional reference words: 3.00 KBCategory: KBSubcategory: IsrTsrWinawar Copyright Microsoft Corporation 1993.