ChangeSelector

Version 3.0

Syntax

WORD ChangeSelector(wDestSelector,wSourceSelector)

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 selector.

Parameter Type/Description  

wDestSelector WORD Specifies a selector previously allocated by AllocSelector that receives the converted selector.  
wSourceSelector WORD Specifies the selector to be converted.  

Return Value

The return value is the copied and converted selector. It is zero if the function failed.

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.

An application should not use this function unless it is absolutely necessary. Use of this function violates preferred Windows programming practices.