Contents of the README.TXT file
This .ZIP file contains a module that contains two functions:
The zyzInt86y() function is used as a replacement for int86x()
that is supplied in the C run-time library. It is designed to
work in a .DLL and take FAR pointers to REGS and SREGS structures.
When your application is terminating, you must call:
This is to free up the selector created by zyzInt86y() on its
Below is an article discussing one of the functions used by the
zyzInt86y() function--to create a valid data selector on top of
the code selector.
KB Title: Use PrestoChangoSelector, ChangeSelector Doesn't exist
Within Windows 3.00, the function ChangeSelector does not exist. If
you try to use it you'll end up with an unresolved external at link
The functionality that ChangeSelector offered is available by using
the undocumented function PrestoChangoSelector. PrestoChangoSelector
is designed to copy the contents of the Local Descriptor Table pointed
to by the source selector into the Local Descriptor Table pointed to
by the destination selector. After copying this information it
toggles the bit associated with whether or not the selector points to
code or data.
If you're planning on using PrestoChangoSelector you'll need to define
a prototype for the function. It should look like:
WORD FAR PASCAL PrestoChangoSelector(WORD wSourceSelector,
Following a the format of other functions in the reference
manual PrestoChangoSelector should be documented as follows:
Prototype: WORD FAR PASCAL PrestoChangoSelector( WORD, WORD);
Syntax: WORD ChangeSelector(wSourceSelector ,wDestSelector)
Objective: This function generates a code selector that
corresponds to a given data selector, or a data
selector that corresponds to a given code selector.
The wSourceSelector parameter specifies the selector
to be copied and converted; the wDestSelector parameter
is a selector previously allocated by a call to the
AllocSelector function. ChangeSelector modifies the
destination selector to have the same properties as
the source selector, but with the opposite code or
data attribute. This function changes only the
attributes of the selector, not the value of the
wSourceSelector WORD Specifies the selector to be converted.
wDestSelector WORD Specifies a selector previously allocated
by AllocSelector that receives the converted
Return Value: undefined
Comments: Windows does not attempt to track changes to
the source selector. Consequently, the application
should use the converted destination selector
immediately after it is returned by this function
before any movement of memory can occur.
NOTE: An application should not use this function unless
it is absolutely necessary. Use of this function
violates preferred Windows programming practices.
The following code fragment demonstrates how to create a code selector
out of a data selector.
WORD wCopyOfDataSelector; // This will contain a copy of the
// information that in associate with
WORD wSelectorToCode; // This will be a executable copy of
// The variable DATA_SELECTOR should contain the selector
// of the memory block that contains some data that you want
// to execute.
if( (wCopyOfDataSelector = AllocSelector(DATA_SELECTOR))) != 0)
if( (wSelectorToCode = PrestoChangoSelector(DATA_SELECTOR,
wCopyOfDataSelector)) != 0)
// At this point you can call code pointed to by the
// wSelectorToCode variable.
return TRUE; // Everything Worked!