NXVmUnregisterExitHandler

Removes a previously registered exit handler so that it is not called when the VM exits (at application exit or unload).

Library:LibC
Classification:NKS
Service:NKS Virtual Machine

Syntax

  #include <nks/vm.h>
   
  int NXVmUnregisterExitHandler (
     void   (*func)( void * ),
     void   *arg );
  

Parameters

func

(IN) Points to a previously registered cleanup function.

arg

(IN) Points to an argument registered with the handler.

Return Values

If successful, returns zero; otherwise, returns an error:

Decimal

Hex

Constant

Description

77

0x4D

NX_ESRCH

The func and arg combination was not found.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

NXVmUnregisterExitHandler disassociates the cleanup function that was previously registered by calling NXVmRegisterExitHandler from the calling application's VM. This is done as a tuple of the function and argument such that a registration of the same function, but with a different argument, will not be removed.

After this call, the cleanup handler and argument will not be called at program unload. If the same clean-up handler/argument tuple has been registered more than once, it is the most recent registration that is removed.

See Also

NXVmRegisterExitHandler