Add some ExitWindowsEx() constants

Francois Gouget fgouget at codeweavers.com
Thu Oct 7 18:34:20 CDT 2004


An application I'm working on needs these. This adds a new header: reason.h


Changelog:

  * include/winreg.h
    include/winuser.h
    include/reason.h

    Francois Gouget <fgouget at codeweavers.com>
    Add some reason codes for ExitWindowsEx().
    Also add EWX_FORCEIFHUNG.

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: include/winreg.h
===================================================================
RCS file: /var/cvs/wine/include/winreg.h,v
retrieving revision 1.27
diff -u -r1.27 winreg.h
--- include/winreg.h	14 Jul 2004 21:44:26 -0000	1.27
+++ include/winreg.h	7 Oct 2004 22:58:25 -0000
@@ -52,6 +52,19 @@
 
 typedef ACCESS_MASK REGSAM;
 
+/*
+ * InitiateSystemShutdown() reasons
+ */
+#include <reason.h>
+
+#define REASON_OTHER            (SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER)
+#define REASON_UNKNOWN          SHTDN_REASON_UNKNOWN
+#define REASON_LEGACY_API       SHTDN_REASON_LEGACY_API
+#define REASON_PLANNED_FLAG     SHTDN_REASON_FLAG_PLANNED
+
+#define MAX_SHUTDOWN_TIMEOUT    (10*365*24*60*60)
+
+
 BOOL        WINAPI AbortSystemShutdownA(LPSTR);
 BOOL        WINAPI AbortSystemShutdownW(LPWSTR);
 #define     AbortSystemShutdown WINELIB_NAME_AW(AbortSystemShutdown)
Index: include/winuser.h
===================================================================
RCS file: /var/cvs/wine/include/winuser.h,v
retrieving revision 1.189
diff -u -r1.189 winuser.h
--- include/winuser.h	7 Oct 2004 17:34:16 -0000	1.189
+++ include/winuser.h	7 Oct 2004 22:58:25 -0000
@@ -2526,6 +2526,7 @@
 #define EWX_REBOOT           2
 #define EWX_FORCE            4
 #define EWX_POWEROFF         8
+#define EWX_FORCEIFHUNG     16
 
 /* SetLastErrorEx types */
 #define	SLE_ERROR	0x00000001
--- /dev/null	2004-09-16 12:47:05.000000000 +0200
+++ include/reason.h	2004-10-08 00:58:25.000000000 +0200
@@ -0,0 +1,44 @@
+/*
+ * ExitWindowsEx() reason codes
+ *
+ * Copyright (C) the Wine project
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_REASON_H
+#define __WINE_REASON_H
+
+
+#define SHTDN_REASON_FLAG_USER_DEFINED            0x40000000
+#define SHTDN_REASON_FLAG_PLANNED                 0x80000000
+
+#define SHTDN_REASON_MAJOR_OTHER                  0x00000000
+#define SHTDN_REASON_MAJOR_NONE                   0x00000000
+#define SHTDN_REASON_MAJOR_HARDWARE               0x00010000
+#define SHTDN_REASON_MAJOR_OPERATINGSYSTEM        0x00020000
+#define SHTDN_REASON_MAJOR_SOFTWARE               0x00030000
+#define SHTDN_REASON_MAJOR_APPLICATION            0x00040000
+#define SHTDN_REASON_MAJOR_SYSTEM                 0x00050000
+#define SHTDN_REASON_MAJOR_POWER                  0x00060000
+#define SHTDN_REASON_MAJOR_LEGACY_API             0x00070000
+
+#define SHTDN_REASON_MINOR_OTHER                  0x00000000
+#define SHTDN_REASON_MINOR_NONE                   0x000000ff
+
+#define SHTDN_REASON_UNKNOWN                      SHTDN_REASON_MINOR_NONE
+#define SHTDN_REASON_LEGACY_API                   (SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED)
+
+#endif


More information about the wine-patches mailing list