Microsoft KB Archive/50901

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 18:25, 12 August 2020 by X010 (talk | contribs) (X010 moved page Microsoft KB Archive/Q50901 to Microsoft KB Archive/50901 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

PROBLEM

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.

RESPONSE

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.