From 54bd4586440bca2404e4a0872a246c1fc5eae439 Mon Sep 17 00:00:00 2001 From: Steven Edwards Date: Mon, 15 Aug 2005 02:24:48 +0000 Subject: [PATCH] Changelog: MSAFD: Add PCH support, PSDK fixes MISC: Fix everything to build with PSDK changes PSDK Fixes: w32api/include/ssdl.h - reimplement based on Wine header which was more correct w32api/include/ntsecapi.h - Remove duplicate structures and add typedef w32api/include/winnt.h - add constant and missing structure w32api/include/winioctl.h - add missing IOCTL code w32api/include/winbase.h - add missing function declariation w32api/include/aclui.h - remove duplicate structure svn path=/trunk/; revision=17394 --- reactos/lib/aclui/precomp.h | 1 + reactos/lib/advapi32/advapi32.h | 4 +- reactos/lib/msafd/include/helpers.h | 2 +- reactos/lib/msafd/misc/dllmain.c | 5 +- reactos/lib/msafd/misc/event.c | 3 +- reactos/lib/msafd/misc/helpers.c | 3 +- reactos/lib/msafd/misc/sndrcv.c | 3 +- reactos/lib/msafd/misc/stubs.c | 1 + reactos/lib/msafd/{include => }/msafd.h | 12 ++-- reactos/lib/msafd/msafd.xml | 1 + reactos/lib/netapi32/wksta.c | 1 + reactos/lib/secur32/lsa.c | 3 +- reactos/lib/snmpapi/snmpapi.c | 7 +-- reactos/lib/ws2_32/include/ws2_32.h | 3 +- reactos/lib/ws2help/ws2help.c | 1 + reactos/lib/ws2help/ws2help.h | 4 +- reactos/lib/wshirda/wshirda.c | 2 + reactos/lib/wshirda/wshirda.h | 4 +- reactos/subsys/system/lsass/lsass.c | 1 - reactos/subsys/system/winlogon/setup.c | 1 - reactos/subsys/system/winlogon/winlogon.h | 1 - reactos/w32api/include/aclui.h | 7 --- reactos/w32api/include/ntsecapi.h | 20 +------ reactos/w32api/include/sddl.h | 73 ++++++++++++++++++++--- reactos/w32api/include/winbase.h | 1 + reactos/w32api/include/winioctl.h | 1 + reactos/w32api/include/winnt.h | 7 +++ 27 files changed, 109 insertions(+), 63 deletions(-) rename reactos/lib/msafd/{include => }/msafd.h (99%) mode change 100644 => 100755 diff --git a/reactos/lib/aclui/precomp.h b/reactos/lib/aclui/precomp.h index 2581fdbbf29..0001269aff9 100644 --- a/reactos/lib/aclui/precomp.h +++ b/reactos/lib/aclui/precomp.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #if SUPPORT_UXTHEME #include diff --git a/reactos/lib/advapi32/advapi32.h b/reactos/lib/advapi32/advapi32.h index 59c518e2e02..9d7f3324d43 100644 --- a/reactos/lib/advapi32/advapi32.h +++ b/reactos/lib/advapi32/advapi32.h @@ -13,11 +13,13 @@ /* PSDK/NDK Headers */ #include -#include #include #define NTOS_MODE_USER #include +/* this has to go after the NDK when being used with the NDK */ +#include + #ifndef HAS_FN_PROGRESSW #define FN_PROGRESSW FN_PROGRESS #endif diff --git a/reactos/lib/msafd/include/helpers.h b/reactos/lib/msafd/include/helpers.h index f8396b7c05b..1b73c669df5 100644 --- a/reactos/lib/msafd/include/helpers.h +++ b/reactos/lib/msafd/include/helpers.h @@ -7,7 +7,7 @@ #ifndef __HELPERS_H #define __HELPERS_H -#include +//#include typedef struct _HELPER_DATA { LIST_ENTRY Helpers; diff --git a/reactos/lib/msafd/misc/dllmain.c b/reactos/lib/msafd/misc/dllmain.c index fdcadf2ef69..03a76b94799 100644 --- a/reactos/lib/msafd/misc/dllmain.c +++ b/reactos/lib/msafd/misc/dllmain.c @@ -10,10 +10,9 @@ * CSH 01/09-2000 Created * Alex 16/07/2004 - Complete Rewrite */ -#include -#include #include -#include + +#include #ifdef DBG //DWORD DebugTraceLevel = DEBUG_ULTRA; diff --git a/reactos/lib/msafd/misc/event.c b/reactos/lib/msafd/misc/event.c index b15c23049af..9719258eb3d 100644 --- a/reactos/lib/msafd/misc/event.c +++ b/reactos/lib/msafd/misc/event.c @@ -10,9 +10,10 @@ * Alex 16/07/2004 - Complete Rewrite */ -#include #include +#include + int WSPAPI WSPEventSelect( diff --git a/reactos/lib/msafd/misc/helpers.c b/reactos/lib/msafd/misc/helpers.c index b515b35e99f..f0bb6a9d5f0 100644 --- a/reactos/lib/msafd/misc/helpers.c +++ b/reactos/lib/msafd/misc/helpers.c @@ -10,7 +10,8 @@ * Alex 16/07/2004 - Complete Rewrite */ #include -#include + +#include CRITICAL_SECTION HelperDLLDatabaseLock; LIST_ENTRY HelperDLLDatabaseListHead; diff --git a/reactos/lib/msafd/misc/sndrcv.c b/reactos/lib/msafd/misc/sndrcv.c index 7c28b66f212..62afc4a8b4c 100644 --- a/reactos/lib/msafd/misc/sndrcv.c +++ b/reactos/lib/msafd/misc/sndrcv.c @@ -10,9 +10,8 @@ * Alex 16/07/2004 - Complete Rewrite */ -#include -#include #include + #include INT diff --git a/reactos/lib/msafd/misc/stubs.c b/reactos/lib/msafd/misc/stubs.c index 349a8d11891..6de00a6965d 100644 --- a/reactos/lib/msafd/misc/stubs.c +++ b/reactos/lib/msafd/misc/stubs.c @@ -9,6 +9,7 @@ */ #include +#include INT WSPAPI diff --git a/reactos/lib/msafd/include/msafd.h b/reactos/lib/msafd/msafd.h old mode 100644 new mode 100755 similarity index 99% rename from reactos/lib/msafd/include/msafd.h rename to reactos/lib/msafd/msafd.h index 17a58ea7584..1bb7497f9a0 --- a/reactos/lib/msafd/include/msafd.h +++ b/reactos/lib/msafd/msafd.h @@ -7,18 +7,20 @@ #ifndef __MSAFD_H #define __MSAFD_H -#include +#include + #include #include -#include #include #include +#define NTOS_MODE_USER +#include + +/* This includes ntsecapi.h so it needs to come after the NDK */ +#include #include #include #include -#define NTOS_MODE_USER -#include -#include extern HANDLE GlobalHeap; extern WSPUPCALLTABLE Upcalls; diff --git a/reactos/lib/msafd/msafd.xml b/reactos/lib/msafd/msafd.xml index ad2ec4432f3..d2f6ba66ad0 100644 --- a/reactos/lib/msafd/msafd.xml +++ b/reactos/lib/msafd/msafd.xml @@ -5,6 +5,7 @@ + msafd.h ntdll kernel32 advapi32 diff --git a/reactos/lib/netapi32/wksta.c b/reactos/lib/netapi32/wksta.c index 6dd7c55f9cc..6430a48bfa1 100644 --- a/reactos/lib/netapi32/wksta.c +++ b/reactos/lib/netapi32/wksta.c @@ -35,6 +35,7 @@ #include "winerror.h" #include "ntstatus.h" #include "winreg.h" +#include "winternl.h" #include "ntsecapi.h" #include "netbios.h" #include "wine/debug.h" diff --git a/reactos/lib/secur32/lsa.c b/reactos/lib/secur32/lsa.c index 92f580dbaca..0a9e92132fb 100644 --- a/reactos/lib/secur32/lsa.c +++ b/reactos/lib/secur32/lsa.c @@ -11,11 +11,12 @@ /* INCLUDES ******************************************************************/ #include -#include #define NTOS_MODE_USER #include #include +#include + /* GLOBALS *******************************************************************/ extern HANDLE Secur32Heap; diff --git a/reactos/lib/snmpapi/snmpapi.c b/reactos/lib/snmpapi/snmpapi.c index 957b02909ff..e62d2100320 100644 --- a/reactos/lib/snmpapi/snmpapi.c +++ b/reactos/lib/snmpapi/snmpapi.c @@ -9,13 +9,8 @@ */ //#include "snmpapi.h" - -#ifdef __GNUC__ -#include -#else -#include -#endif #include +#include #ifdef __GNUC__ #define SNMP_FUNC_TYPE STDCALL diff --git a/reactos/lib/ws2_32/include/ws2_32.h b/reactos/lib/ws2_32/include/ws2_32.h index 3facacc3be3..9934df69d7e 100644 --- a/reactos/lib/ws2_32/include/ws2_32.h +++ b/reactos/lib/ws2_32/include/ws2_32.h @@ -12,10 +12,11 @@ #include #include #include -#include #define NTOS_MODE_USER #include +#include + #undef assert #include #include // DNS_A_DATA diff --git a/reactos/lib/ws2help/ws2help.c b/reactos/lib/ws2help/ws2help.c index 66a0040f22c..b670756f0d4 100644 --- a/reactos/lib/ws2help/ws2help.c +++ b/reactos/lib/ws2help/ws2help.c @@ -9,6 +9,7 @@ */ #include "ws2help.h" +#include #ifdef DBG /* See debug.h for debug/trace constants */ diff --git a/reactos/lib/ws2help/ws2help.h b/reactos/lib/ws2help/ws2help.h index ea9cd193625..17480c4f700 100644 --- a/reactos/lib/ws2help/ws2help.h +++ b/reactos/lib/ws2help/ws2help.h @@ -7,11 +7,11 @@ #ifndef __WS2HELP_H #define __WS2HELP_H -#include #include #define NTOS_MODE_USER #include -#include + +#include #define EXPORT STDCALL diff --git a/reactos/lib/wshirda/wshirda.c b/reactos/lib/wshirda/wshirda.c index 9c91f5361ed..c8144a001af 100644 --- a/reactos/lib/wshirda/wshirda.c +++ b/reactos/lib/wshirda/wshirda.c @@ -9,6 +9,8 @@ */ #include "wshirda.h" +#include + #ifdef DBG /* See debug.h for debug/trace constants */ diff --git a/reactos/lib/wshirda/wshirda.h b/reactos/lib/wshirda/wshirda.h index 1f7149d4b45..3f202c75c65 100644 --- a/reactos/lib/wshirda/wshirda.h +++ b/reactos/lib/wshirda/wshirda.h @@ -7,11 +7,11 @@ #ifndef __WSHIRDA_H #define __WSHIRDA_H -#include #include #define NTOS_MODE_USER #include -#include + +#include #define EXPORT STDCALL diff --git a/reactos/subsys/system/lsass/lsass.c b/reactos/subsys/system/lsass/lsass.c index 8114fb649d5..b9a1fc218d7 100644 --- a/reactos/subsys/system/lsass/lsass.c +++ b/reactos/subsys/system/lsass/lsass.c @@ -26,7 +26,6 @@ * Compiled successfully with egcs 1.1.2 */ #include -#include #define NTOS_MODE_USER #include diff --git a/reactos/subsys/system/winlogon/setup.c b/reactos/subsys/system/winlogon/setup.c index 1b8cb54ae15..38d4572f1e1 100644 --- a/reactos/subsys/system/winlogon/setup.c +++ b/reactos/subsys/system/winlogon/setup.c @@ -28,7 +28,6 @@ #include #include -#include #include #include "setup.h" diff --git a/reactos/subsys/system/winlogon/winlogon.h b/reactos/subsys/system/winlogon/winlogon.h index fde30ffb0e1..35ec0548c70 100644 --- a/reactos/subsys/system/winlogon/winlogon.h +++ b/reactos/subsys/system/winlogon/winlogon.h @@ -28,7 +28,6 @@ #define __WINLOGON_MAIN_H__ #include -#include #include #include #define NTOS_MODE_USER diff --git a/reactos/w32api/include/aclui.h b/reactos/w32api/include/aclui.h index 48d2eb4c845..90fd6bb8d0b 100644 --- a/reactos/w32api/include/aclui.h +++ b/reactos/w32api/include/aclui.h @@ -34,13 +34,6 @@ DEFINE_GUID(IID_ISecurityInformation2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0x00a3, 0xce, DEFINE_GUID(IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x0088, 0xa1,0xd1,0x93,0x44,0x36,0x5f,0xbc); DEFINE_GUID(IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x0091, 0x11,0xd1,0x8a,0x75,0xeb,0xf2,0xfa); -/* FIXME - defined in structs.h already!? avoid conflicts! */ -typedef struct _OBJECT_TYPE_LIST { - WORD Level; - WORD Sbz; - GUID *ObjectType; -} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST; - typedef interface ISecurityInformation *LPSECURITYINFO; typedef interface ISecurityInformation2 *LPSECURITYINFO2; typedef interface IEffectivePermission *LPEFFECTIVEPERMISSION; diff --git a/reactos/w32api/include/ntsecapi.h b/reactos/w32api/include/ntsecapi.h index f1c527d8af3..1e45bbec437 100644 --- a/reactos/w32api/include/ntsecapi.h +++ b/reactos/w32api/include/ntsecapi.h @@ -124,17 +124,6 @@ extern "C" { #define TRUST_TYPE_DCE 4 #if !defined(_NTDEF_H) && !defined(_SUBAUTH_H) typedef LONG NTSTATUS, *PNTSTATUS; -typedef struct _UNICODE_STRING { - USHORT Length; - USHORT MaximumLength; - PWSTR Buffer; -} UNICODE_STRING, *PUNICODE_STRING; -typedef const UNICODE_STRING* PCUNICODE_STRING; -typedef struct _STRING { - USHORT Length; - USHORT MaximumLength; - PCHAR Buffer; -} STRING, *PSTRING; #endif typedef UNICODE_STRING LSA_UNICODE_STRING, *PLSA_UNICODE_STRING; typedef STRING LSA_STRING, *PLSA_STRING; @@ -294,14 +283,7 @@ typedef struct _LSA_ENUMERATION_INFORMATION { } LSA_ENUMERATION_INFORMATION, *PLSA_ENUMERATION_INFORMATION; typedef ULONG LSA_OPERATIONAL_MODE, *PLSA_OPERATIONAL_MODE; #if !defined(_NTDEF_H) -typedef struct _LSA_OBJECT_ATTRIBUTES { - ULONG Length; - HANDLE RootDirectory; - PLSA_UNICODE_STRING ObjectName; - ULONG Attributes; - PVOID SecurityDescriptor; - PVOID SecurityQualityOfService; -} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; +typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES; #endif typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES; typedef struct _LSA_FOREST_TRUST_DOMAIN_INFO { diff --git a/reactos/w32api/include/sddl.h b/reactos/w32api/include/sddl.h index 10ab1659571..2afc0573490 100644 --- a/reactos/w32api/include/sddl.h +++ b/reactos/w32api/include/sddl.h @@ -1,15 +1,71 @@ -#ifndef _SDDL_H -#define _SDDL_H -#if __GNUC__ >=3 -#pragma GCC system_header -#endif +/* + * Copyright (C) 2003 Ulrich Czekalla for CodeWeavers + * + * 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 __SDDL_H__ +#define __SDDL_H__ + #ifdef __cplusplus extern "C" { #endif -BOOL WINAPI ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid); -BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid); +/* + * SDDL Version information + */ +#define SDDL_REVISION_1 1 +#define SDDL_REVISION SDDL_REVISION_1 + +/* + * SDDL Component tags + */ +#define SDDL_OWNER TEXT("O") +#define SDDL_GROUP TEXT("G") +#define SDDL_DACL TEXT("D") +#define SDDL_SACL TEXT("S") + +/* + * SDDL Separators - character version + */ +#define SDDL_SEPERATORC TEXT(";") +#define SDDL_DELIMINATORC TEXT(":") +#define SDDL_ACE_BEGINC TEXT("(") +#define SDDL_ACE_ENDC TEXT(")") + +/* + * SDDL Separators - string version + */ +#define SDDL_SEPERATOR TEXT(";") +#define SDDL_DELIMINATOR TEXT(":") +#define SDDL_ACE_BEGIN TEXT("(") +#define SDDL_ACE_END TEXT(")") + +BOOL WINAPI ConvertSidToStringSidA( PSID, LPSTR* ); +BOOL WINAPI ConvertSidToStringSidW( PSID, LPWSTR* ); +BOOL WINAPI ConvertStringSidToSidA( LPCSTR, PSID* ); +BOOL WINAPI ConvertStringSidToSidW( LPCWSTR, PSID* ); +BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA( + LPCSTR, DWORD, PSECURITY_DESCRIPTOR*, PULONG ); +BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW( + LPCWSTR, DWORD, PSECURITY_DESCRIPTOR*, PULONG ); +BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA( + PSECURITY_DESCRIPTOR, DWORD, SECURITY_INFORMATION, LPSTR*, PULONG ); +BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW( + PSECURITY_DESCRIPTOR, DWORD, SECURITY_INFORMATION, LPWSTR*, PULONG ); #ifdef UNICODE #define ConvertSidToStringSid ConvertSidToStringSidW @@ -20,4 +76,5 @@ BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid); #ifdef __cplusplus } #endif -#endif /* ! defined _SDDL_H */ + +#endif /* __SDDL_H__ */ diff --git a/reactos/w32api/include/winbase.h b/reactos/w32api/include/winbase.h index bd5511a56cc..51e4c6a04c0 100644 --- a/reactos/w32api/include/winbase.h +++ b/reactos/w32api/include/winbase.h @@ -1057,6 +1057,7 @@ void WINAPI AddRefActCtx(HANDLE); #if (_WIN32_WINNT >= 0x0500) PVOID WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER); #endif +BOOL WINAPI AccessCheckByType(PSECURITY_DESCRIPTOR,PSID,HANDLE,DWORD,POBJECT_TYPE_LIST,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL); BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD); BOOL WINAPI AdjustTokenPrivileges(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD); BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID*); diff --git a/reactos/w32api/include/winioctl.h b/reactos/w32api/include/winioctl.h index 2ade0b24bfe..00e04b59b72 100644 --- a/reactos/w32api/include/winioctl.h +++ b/reactos/w32api/include/winioctl.h @@ -74,6 +74,7 @@ extern "C" { #define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS) #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,6,METHOD_BUFFERED,FILE_ANY_ACCESS) #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,7,METHOD_BUFFERED,FILE_ANY_ACCESS) +#define FSCTL_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,8,METHOD_BUFFERED,FILE_ANY_ACCESS) #define FSCTL_MOUNT_DBLS_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,13,METHOD_BUFFERED,FILE_ANY_ACCESS) #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,15,METHOD_BUFFERED,FILE_ANY_ACCESS) diff --git a/reactos/w32api/include/winnt.h b/reactos/w32api/include/winnt.h index d4c4d6c862b..f26875bef28 100644 --- a/reactos/w32api/include/winnt.h +++ b/reactos/w32api/include/winnt.h @@ -190,6 +190,7 @@ typedef DWORD FLONG; #define CONTAINER_INHERIT_ACE 2 #define NO_PROPAGATE_INHERIT_ACE 4 #define INHERIT_ONLY_ACE 8 +#define INHERITED_ACE 10 #define VALID_INHERIT_FLAGS 16 #define SUCCESSFUL_ACCESS_ACE_FLAG 64 #define FAILED_ACCESS_ACE_FLAG 128 @@ -3492,6 +3493,12 @@ RtlCompareMemory ( #define RtlFillMemory(d,l,f) memset((d), (f), (l)) #define RtlZeroMemory(d,l) RtlFillMemory((d),(l),0) +typedef struct _OBJECT_TYPE_LIST { + WORD Level; + WORD Sbz; + GUID *ObjectType; +} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST; + #if defined(__GNUC__) static __inline__ PVOID GetCurrentFiber(void)