Re: [Mingw-w64-public] [PATCH] headers: Add missing names in winsvc.h

2021-07-02 Thread LIU Hao

在 2021-06-30 12:29, Biswapriyo Nath 写道:

Same mistake as previous. How did you catch those warnings? I copied
the modified header to /mingw64/x86_64-w43-mingw32/include folder then
compile a simple file with `#include `. But gcc and clang
shows nothing. I did something wrong but can't figure it out.



GCC does not warn about code in system paths. I usually use this command to 
examine headers:

  /mingw32/bin/gcc -xc++ -fsyntax-only -ansi -Wall -Wextra  \
-D_WIN32_WINNT=0x -Wno-{long-long,expansion-to-defined}  \
-Imingw-w64-headers/include/  -include windows.h  \
mingw-w64-headers/include/winsvc.h

Hope it helps.


I pushed this patch, following a commit that removed those two erroneous macros.



--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] headers: Add missing names in winsvc.h

2021-06-30 Thread LIU Hao

在 6/30/21 12:29 PM, Biswapriyo Nath 写道:

Same mistake as previous. How did you catch those warnings? I copied
the modified header to /mingw64/x86_64-w43-mingw32/include folder then
compile a simple file with `#include `. But gcc and clang
shows nothing. I did something wrong but can't figure it out.




I did that by hand; not sure whether you would like it each time:

  ```
  gcc -E -D_WIN32_WINNT=0x 'C:\Program Files (x86)\Windows 
Kits\10\Include\10.0.19041.0\um\winsvc.h' -Wp,-dM -include minwindef.h | sort -u > ~/Desktop/winsdk.i
  gcc -E -D_WIN32_WINNT=0x 'mingw-w64-headers/include/winsvc.h'  -Wp,-dM -include minwindef.h | 
sort -u > ~/Desktop/mingw-w64.i

  git diff --no-index ~/Desktop/{winsdk,mingw-w64}.i
  ```

Our headers are left behind Windows SDK a bit, so it's fine for there to be a few deletions. OTOH 
additions usually indicate mismatches, which are sometimes mistakes.



--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] headers: Add missing names in winsvc.h

2021-06-29 Thread Biswapriyo Nath
Same mistake as previous. How did you catch those warnings? I copied
the modified header to /mingw64/x86_64-w43-mingw32/include folder then
compile a simple file with `#include `. But gcc and clang
shows nothing. I did something wrong but can't figure it out.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] headers: Add missing names in winsvc.h

2021-06-29 Thread LIU Hao

在 2021-06-29 18:13, Biswapriyo Nath 写道:

 From 152155ec38dd68f1a59880dd4f7b410756325eb0 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath
Date: Tue, 29 Jun 2021 15:41:41 +0530
Subject: [PATCH] headers: Add missing names in winsvc.h

Signed-off-by: Biswapriyo Nath
---
  mingw-w64-headers/include/winsvc.h | 113 +
  1 file changed, 113 insertions(+)


This patch looks good itself, but I have discovered some old, incorrect definitions. Should they be 
removed at the same time?


  ```
  In file included from mingw-w64-headers/include/windows.h:122,
   from :
  mingw-w64-headers/include/winsvc.h:482: warning: 
"SERVICE_STOP_REASON_MINOR_NONE" redefined
482 | #define SERVICE_STOP_REASON_MINOR_NONE 0x0006
|
  mingw-w64-headers/include/winsvc.h:171: note: this is the location of the 
previous definition
171 | #define SERVICE_STOP_REASON_MINOR_NONE 0x0017
|
  mingw-w64-headers/include/winsvc.h:492: warning: 
"SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL" redefined

492 | #define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL 0x000e
|
  mingw-w64-headers/include/winsvc.h:168: note: this is the location of the 
previous definition
168 | #define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL 0x0014
|
  ```


--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] headers: Add missing names in winsvc.h

2021-06-29 Thread Biswapriyo Nath

From 152155ec38dd68f1a59880dd4f7b410756325eb0 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath 
Date: Tue, 29 Jun 2021 15:41:41 +0530
Subject: [PATCH] headers: Add missing names in winsvc.h

Signed-off-by: Biswapriyo Nath 
---
 mingw-w64-headers/include/winsvc.h | 113 +
 1 file changed, 113 insertions(+)

diff --git a/mingw-w64-headers/include/winsvc.h 
b/mingw-w64-headers/include/winsvc.h
index 182db88..fb66e5b 100644
--- a/mingw-w64-headers/include/winsvc.h
+++ b/mingw-w64-headers/include/winsvc.h
@@ -48,6 +48,12 @@ extern "C" {
 #define SERVICE_CONTROL_HARDWAREPROFILECHANGE 0x000C
 #define SERVICE_CONTROL_POWEREVENT 0x000D
 #define SERVICE_CONTROL_SESSIONCHANGE 0x000E
+#define SERVICE_CONTROL_PRESHUTDOWN 0x000F
+#define SERVICE_CONTROL_TIMECHANGE 0x0010
+#define SERVICE_CONTROL_USER_LOGOFF 0x0011
+#define SERVICE_CONTROL_TRIGGEREVENT 0x0020
+#define SERVICE_CONTROL_LOWRESOURCES 0x0060
+#define SERVICE_CONTROL_SYSTEMLOWRESOURCES 0x0061
 
 #define SERVICE_STOPPED 0x0001
 #define SERVICE_START_PENDING 0x0002
@@ -65,6 +71,12 @@ extern "C" {
 #define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 0x0020
 #define SERVICE_ACCEPT_POWEREVENT 0x0040
 #define SERVICE_ACCEPT_SESSIONCHANGE 0x0080
+#define SERVICE_ACCEPT_PRESHUTDOWN 0x0100
+#define SERVICE_ACCEPT_TIMECHANGE 0x0200
+#define SERVICE_ACCEPT_TRIGGEREVENT 0x0400
+#define SERVICE_ACCEPT_USER_LOGOFF 0x0800
+#define SERVICE_ACCEPT_LOWRESOURCES 0x2000
+#define SERVICE_ACCEPT_SYSTEMLOWRESOURCES 0x4000
 
 #define SC_MANAGER_CONNECT 0x0001
 #define SC_MANAGER_CREATE_SERVICE 0x0002
@@ -91,6 +103,107 @@ extern "C" {
 
 #define SERVICE_CONFIG_DESCRIPTION 1
 #define SERVICE_CONFIG_FAILURE_ACTIONS 2
+#define SERVICE_CONFIG_DELAYED_AUTO_START_INFO 3
+#define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG 4
+#define SERVICE_CONFIG_SERVICE_SID_INFO 5
+#define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6
+#define SERVICE_CONFIG_PRESHUTDOWN_INFO 7
+#define SERVICE_CONFIG_TRIGGER_INFO 8
+#define SERVICE_CONFIG_PREFERRED_NODE 9
+#define SERVICE_CONFIG_LAUNCH_PROTECTED 12
+
+#define SERVICE_NOTIFY_STATUS_CHANGE_1 1
+#define SERVICE_NOTIFY_STATUS_CHANGE_2 2
+
+#define SERVICE_NOTIFY_STATUS_CHANGE SERVICE_NOTIFY_STATUS_CHANGE_2
+
+#define SERVICE_NOTIFY_STOPPED 0x0001
+#define SERVICE_NOTIFY_START_PENDING 0x0002
+#define SERVICE_NOTIFY_STOP_PENDING 0x0004
+#define SERVICE_NOTIFY_RUNNING 0x0008
+#define SERVICE_NOTIFY_CONTINUE_PENDING 0x0010
+#define SERVICE_NOTIFY_PAUSE_PENDING 0x0020
+#define SERVICE_NOTIFY_PAUSED 0x0040
+#define SERVICE_NOTIFY_CREATED 0x0080
+#define SERVICE_NOTIFY_DELETED 0x0100
+#define SERVICE_NOTIFY_DELETE_PENDING 0x0200
+
+#define SERVICE_STOP_REASON_FLAG_MIN 0x
+#define SERVICE_STOP_REASON_FLAG_UNPLANNED 0x1000
+#define SERVICE_STOP_REASON_FLAG_CUSTOM 0x2000
+#define SERVICE_STOP_REASON_FLAG_PLANNED 0x4000
+#define SERVICE_STOP_REASON_FLAG_MAX 0x8000
+
+#define SERVICE_STOP_REASON_MAJOR_MIN 0x
+#define SERVICE_STOP_REASON_MAJOR_OTHER 0x0001
+#define SERVICE_STOP_REASON_MAJOR_HARDWARE 0x0002
+#define SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM 0x0003
+#define SERVICE_STOP_REASON_MAJOR_SOFTWARE 0x0004
+#define SERVICE_STOP_REASON_MAJOR_APPLICATION 0x0005
+#define SERVICE_STOP_REASON_MAJOR_NONE 0x0006
+#define SERVICE_STOP_REASON_MAJOR_MAX 0x0007
+#define SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM 0x0040
+#define SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM 0x00ff
+
+#define SERVICE_STOP_REASON_MINOR_MIN 0x
+#define SERVICE_STOP_REASON_MINOR_OTHER 0x0001
+#define SERVICE_STOP_REASON_MINOR_MAINTENANCE 0x0002
+#define SERVICE_STOP_REASON_MINOR_INSTALLATION 0x0003
+#define SERVICE_STOP_REASON_MINOR_UPGRADE 0x0004
+#define SERVICE_STOP_REASON_MINOR_RECONFIG 0x0005
+#define SERVICE_STOP_REASON_MINOR_HUNG 0x0006
+#define SERVICE_STOP_REASON_MINOR_UNSTABLE 0x0007
+#define SERVICE_STOP_REASON_MINOR_DISK 0x0008
+#define SERVICE_STOP_REASON_MINOR_NETWORKCARD 0x0009
+#define SERVICE_STOP_REASON_MINOR_ENVIRONMENT 0x000a
+#define SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER 0x000b
+#define SERVICE_STOP_REASON_MINOR_OTHERDRIVER 0x000c
+#define SERVICE_STOP_REASON_MINOR_SERVICEPACK 0x000d
+#define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE 0x000e
+#define SERVICE_STOP_REASON_MINOR_SECURITYFIX 0x000f
+#define SERVICE_STOP_REASON_MINOR_SECURITY 0x0010
+#define SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY 0x0011
+#define SERVICE_STOP_REASON_MINOR_WMI 0x0012
+#define SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL 0x0013
+#define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL 0x0014
+#define SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL 0x0015
+#define SERVICE_STOP_REASON_MINOR_MMC 0x0016
+#define SERVICE_STOP_REASON_MINOR_NONE 0x0017
+#define SERVICE_STOP_REASON_MINOR_MEMOTYLIMIT 0x0018