winapi-rs icon indicating copy to clipboard operation
winapi-rs copied to clipboard

Added missing constants

Open tim-weis opened this issue 4 years ago • 1 comments

Resolves #915.

This is a backwards compatible change. All identifiers and associated values have been copy-pasted from the respective Windows SDK header file.

tim-weis avatar Jul 15 '20 08:07 tim-weis

LGTM :+1:

Relevant header code

winbase.h:

//
// Max length of commandline in characters (including the NULL character that can be registered for restart)
//
#define RESTART_MAX_CMD_LINE    1024

//
// Do not restart the process for termination due to application crashes
//
#define RESTART_NO_CRASH        1

//
// Do not restart the process for termination due to application hangs
//
#define RESTART_NO_HANG         2

//
// Do not restart the process for termination due to patch installations
//
#define RESTART_NO_PATCH        4

//
// Do not restart the process when the system is rebooted due to patch installations
//
#define RESTART_NO_REBOOT        8

#define RECOVERY_DEFAULT_PING_INTERVAL  5000
#define RECOVERY_MAX_PING_INTERVAL      (5 * 60 * 1000)
  • Organization of code

    • All definitions go into the source file that directly maps to the header the definition is from: :heavy_check_mark:
    • Definitions are defined in the same order as they are in the original header: :heavy_check_mark:
  • Constants

    • Names are correct: :heavy_check_mark:
    • Values are correct: :heavy_check_mark:
    • Types are correct:
      • RESTART_NO_* are passed to RegisterApplicationRestart' dwFlags, a DWORD: :heavy_check_mark:
      • RESTART_MAX_CMD_LINE defines the max size of a char array, a usize: :heavy_check_mark:
      • RECOVERY_*_PING_INTERVAL are passed to RegisterApplicationRecoveryCallback's dwPingInterval, a DWORD: :heavy_check_mark:

roblabla avatar Nov 27 '20 20:11 roblabla