PRB: SetEnvironment() Returns Incorrect Values

ID Number: Q76590

3.00

WINDOWS

docerr

Summary:

SYMPTOMS

SetEnvironment() returns unexpected values when used to delete an

environment.

CAUSE

SetEnvironment() returns 1 when an environment is successfully

deleted, not -1 as documented in the "Windows Software Development

Kit Reference Volume 1" for version 3.0.

STATUS

The documentation is incorrect.

More Information:

SetEnvironment loads 1 only into al, not ax; therefore, upon return

from a successful delete, the high portion of the returned int (short)

can contain a random value, depending on how many bytes SetEnvironment

copied. SetEnvironment returns 0 (zero) upon failure, as documented.

Additional reference words: 3.00