---
So svcctl.idl needs the SECURITY_INFORMATION definition and it's not available from any other idl file. This results in this type being defined twice when compiling dlls/advapi32/service.c: once in winnt.h and then again in dlls/advapi32/svcctl.h.
We normally avoid this type of situation. An easy fix is to introduce the usual _XXX_DEFINED macro check but this seems to be a first in an idl file. Is there a better way?
include/wine/svcctl.idl | 3 +++ include/winnt.h | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/include/wine/svcctl.idl b/include/wine/svcctl.idl index e8463b5..1c3d22f 100644 --- a/include/wine/svcctl.idl +++ b/include/wine/svcctl.idl @@ -65,7 +65,10 @@ interface svcctl typedef [context_handle] void *SC_RPC_LOCK; typedef [context_handle] void *SC_NOTIFY_RPC_HANDLE;
+ cpp_quote("#ifndef _SECURITY_INFORMATION_DEFINED") + cpp_quote("#define _SECURITY_INFORMATION_DEFINED") typedef DWORD SECURITY_INFORMATION; + cpp_quote("#endif")
/* undocumented access rights */ cpp_quote("#define SERVICE_SET_STATUS 0x8000") diff --git a/include/winnt.h b/include/winnt.h index 4b06b2c..0a4185d 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -3971,7 +3971,10 @@ static const WCHAR SE_CREATE_GLOBAL_NAME[] = { 'S','e','C','r','e','a','t','e',' #define SE_RM_CONTROL_VALID 0x00004000 #define SE_SELF_RELATIVE 0x00008000
+#ifndef _SECURITY_INFORMATION_DEFINED +#define _SECURITY_INFORMATION_DEFINED typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION; +#endif typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
/* The security descriptor structure */
On 28.02.2015 13:33, Francois Gouget wrote:
So svcctl.idl needs the SECURITY_INFORMATION definition and it's not available from any other idl file. This results in this type being defined twice when compiling dlls/advapi32/service.c: once in winnt.h and then again in dlls/advapi32/svcctl.h.
We normally avoid this type of situation. An easy fix is to introduce the usual _XXX_DEFINED macro check but this seems to be a first in an idl file. Is there a better way?
I think I screwed up it a little, does it work if you place it inside #if 0, after this:
--- cpp_quote("#if 0 /* already defined in winsvc.h */") ---
I think we only need it for widl, and later advapi32 or services should include winnt.h in usual way.