NTSYSAPI
BOOLEAN
NTAPI
NtIsSystemResumeAutomatic(
      VOID 
  );

Routine Description:

    Returns whether or not the most recent wake was automatic
    or due to a user action.

Arguments:

    None

Return Value:

    TRUE - The system was awakened due to a timer or device wake

    FALSE - The system was awakened due to a user action