DosSysCtl

Syntax
DosSysCtl(ULONG func, ULONG p);

Remarks
It is not declared in the headers but it is in the standard import libraries (DOSCALLS.876). The DosSysCtl function may be used for detecting whether we're being debugged or not.

Check also Query the DosError state.