PRB: Fatal Exit 0x00FF: MakeProcInstance for Current Instance

ID Number: Q74363

3.00

WINDOWS

Summary:

SYMPTOMS

An application running under the Microsoft Windows graphical

environment receives FatalExit error 0x00FF, "MakeProcInstance only

for Current Instance."

CAUSE

A function in a dynamic-link library (DLL) calls the

MakeProcInstance function using an application's instance handle.

The FatalExit occurs because the current value of the DS register

does not match the instance handle passed to MakeProcInstance.

RESOLUTION

If a function in a DLL calls MakeProcInstance on behalf of an

application, the function must be exported as a NODATA function in

the module definition (DEF) file for the DLL. This causes the

function to use the same data segment as the calling application.

More Information:

When an application is executing, the value of the DS register is

equal to the application's data segment, which is identified by the

application's instance handle.

By default, when an application calls an exported DLL function, the

value of the DS register is set to the data segment of the DLL.

However, if the DLL function is exported with the NODATA option, the

value of the DS register does not change when the function is called.

In this case, the DLL can safely call the MakeProcInstance function

using the calling application's instance handle because the current

value of the DS register is the same as the instance handle passed to

MakeProcInstance.

Additional reference words: 3.00 RIP FF