2009-10-12 03:35:35 +00:00
|
|
|
#ifndef __SHUTDOWN_PRECOMP_H
|
|
|
|
#define __SHUTDOWN_PRECOMP_H
|
|
|
|
|
2012-12-14 23:29:22 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
2014-01-13 12:41:18 +00:00
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <stdarg.h>
|
2014-01-13 12:41:18 +00:00
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winreg.h>
|
|
|
|
#include <winuser.h>
|
|
|
|
|
2009-10-12 03:35:35 +00:00
|
|
|
#include "resource.h"
|
|
|
|
|
2012-12-14 23:29:22 +00:00
|
|
|
/* DEFINES *******************************************************************/
|
|
|
|
#define MAX_MESSAGE_SIZE 512
|
|
|
|
#define MAX_MAJOR_CODE 256
|
|
|
|
#define MAX_MINOR_CODE 65536
|
|
|
|
#define MAX_TIMEOUT 315360000
|
|
|
|
#define MAX_BUFFER_SIZE 5024
|
|
|
|
|
|
|
|
/* Reason Code List */
|
|
|
|
typedef struct _REASON
|
|
|
|
{
|
|
|
|
LPWSTR prefix;
|
|
|
|
int major;
|
|
|
|
int minor;
|
|
|
|
DWORD flag;
|
|
|
|
} REASON, *PREASON;
|
|
|
|
|
|
|
|
/* Used to determine how to shutdown the system. */
|
|
|
|
struct CommandLineOptions
|
|
|
|
{
|
|
|
|
BOOL abort;
|
|
|
|
BOOL force;
|
|
|
|
BOOL logoff;
|
|
|
|
BOOL restart;
|
|
|
|
BOOL shutdown;
|
|
|
|
BOOL document_reason;
|
|
|
|
BOOL hibernate;
|
|
|
|
DWORD shutdown_delay;
|
|
|
|
LPWSTR remote_system;
|
|
|
|
LPWSTR message;
|
|
|
|
DWORD reason;
|
|
|
|
BOOL show_gui;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const DWORD defaultReason;
|
|
|
|
|
|
|
|
/* PROTOTYPES *****************************************************************/
|
|
|
|
|
|
|
|
/* misc.c */
|
|
|
|
BOOL CheckCommentLength(LPCWSTR);
|
|
|
|
DWORD ParseReasonCode(LPCWSTR);
|
|
|
|
VOID DisplayError(DWORD dwError);
|
|
|
|
|
|
|
|
/* gui.c */
|
|
|
|
BOOL ShutdownGuiMain(struct CommandLineOptions opts);
|
2009-10-12 03:35:35 +00:00
|
|
|
|
2014-01-13 12:41:18 +00:00
|
|
|
#endif /* __SHUTDOWN_PRECOMP_H */
|