[ADVAPI32] Implementation of BuildTrusteeWith* functions
Dan Wolf
djwolf at realitywave.com
Sat Aug 16 11:18:07 CDT 2003
This patch is against the wine-20030813 release.
ChangeLog:
Implement the following functions:
BuildTrusteeWithNameA
BuildTrusteeWithNameW
BuildTrusteeWithObjectsAndNameA
BuildTrusteeWithObjectsAndNameW
BuildTrusteeWithObjectsAndSidA
BuildTrusteeWithObjectsAndSidW
BuildTrusteeWithSidA
BuildTrusteeWithSidW
Daniel J. Wolf <djwolf at realitywave.com>
-------------- next part --------------
diff -u -r wine-20030813\dlls\advapi32\advapi32.spec wine\dlls\advapi32\advapi32.spec
--- wine-20030813\dlls\advapi32\advapi32.spec Wed Aug 13 15:34:58 2003
+++ wine\dlls\advapi32\advapi32.spec Sat Aug 16 12:02:36 2003
@@ -18,6 +18,12 @@
@ stub AreAnyAccessesGranted
@ stdcall BackupEventLogA (long str)
@ stdcall BackupEventLogW (long wstr)
+@ stdcall BuildTrusteeWithNameA(ptr str)
+@ stdcall BuildTrusteeWithNameW(ptr wstr)
+@ stdcall BuildTrusteeWithObjectsAndNameA(ptr ptr long str str str)
+@ stdcall BuildTrusteeWithObjectsAndNameW(ptr ptr long wstr wstr wstr)
+@ stdcall BuildTrusteeWithObjectsAndSidA(ptr ptr ptr ptr ptr)
+@ stdcall BuildTrusteeWithObjectsAndSidW(ptr ptr ptr ptr ptr)
@ stdcall BuildTrusteeWithSidA(ptr ptr)
@ stdcall BuildTrusteeWithSidW(ptr ptr)
@ stub ChangeServiceConfigA
diff -u -r wine-20030813\dlls\advapi32\security.c wine\dlls\advapi32\security.c
--- wine-20030813\dlls\advapi32\security.c Tue Aug 12 14:53:14 2003
+++ wine\dlls\advapi32\security.c Sat Aug 16 12:06:06 2003
@@ -1336,11 +1336,163 @@
}
/******************************************************************************
+ * BuildTrusteeWithNameA [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR pName)
+{
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = pName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithNameW [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR pName)
+{
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = pName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndNameA [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithObjectsAndNameA(
+ PTRUSTEEA pTrustee, POBJECTS_AND_NAME_A pObjName,
+ SE_OBJECT_TYPE ObjectType, LPSTR ObjectTypeName,
+ LPSTR InheritedObjectTypeName, LPSTR Name)
+{
+ ZeroMemory(pObjName, sizeof(OBJECTS_AND_NAME_A));
+ pObjName->ptstrName = Name;
+ pObjName->ObjectType = ObjectType;
+
+ if (ObjectTypeName)
+ {
+ pObjName->ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ pObjName->ObjectTypeName = ObjectTypeName;
+ }
+
+ if (InheritedObjectTypeName)
+ {
+ pObjName->ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ pObjName->InheritedObjectTypeName = InheritedObjectTypeName;
+ }
+
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPSTR) pObjName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndNameW [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithObjectsAndNameW(
+ PTRUSTEEW pTrustee, POBJECTS_AND_NAME_W pObjName,
+ SE_OBJECT_TYPE ObjectType, LPWSTR ObjectTypeName,
+ LPWSTR InheritedObjectTypeName, LPWSTR Name)
+{
+ ZeroMemory(pObjName, sizeof(OBJECTS_AND_NAME_W));
+ pObjName->ptstrName = Name;
+ pObjName->ObjectType = ObjectType;
+
+ if (ObjectTypeName)
+ {
+ pObjName->ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ pObjName->ObjectTypeName = ObjectTypeName;
+ }
+
+ if (InheritedObjectTypeName)
+ {
+ pObjName->ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ pObjName->InheritedObjectTypeName = InheritedObjectTypeName;
+ }
+
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPWSTR) pObjName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndSidA [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithObjectsAndSidA(
+ PTRUSTEEA pTrustee, POBJECTS_AND_SID pObjSid,
+ GUID *pObjectGuid, GUID *pInheritedObjectGuid, PSID pSid)
+{
+ ZeroMemory(pObjSid, sizeof(OBJECTS_AND_SID));
+ pObjSid->pSid = (SID*) pSid;
+
+ if (pObjectGuid)
+ {
+ pObjSid->ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ CopyMemory(&pObjSid->ObjectTypeGuid, pObjectGuid, sizeof(GUID));
+ }
+
+ if (pInheritedObjectGuid)
+ {
+ pObjSid->ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ CopyMemory(&pObjSid->InheritedObjectTypeGuid,
+ pInheritedObjectGuid,
+ sizeof(GUID));
+ }
+
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPSTR) pObjSid;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndSidW [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithObjectsAndSidW(
+ PTRUSTEEW pTrustee, POBJECTS_AND_SID pObjSid,
+ GUID *pObjectGuid, GUID *pInheritedObjectGuid, PSID pSid)
+{
+ ZeroMemory(pObjSid, sizeof(OBJECTS_AND_SID));
+ pObjSid->pSid = (SID*) pSid;
+
+ if (pObjectGuid)
+ {
+ pObjSid->ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ CopyMemory(&pObjSid->ObjectTypeGuid, pObjectGuid, sizeof(GUID));
+ }
+
+ if (pInheritedObjectGuid)
+ {
+ pObjSid->ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ CopyMemory(&pObjSid->InheritedObjectTypeGuid,
+ pInheritedObjectGuid,
+ sizeof(GUID));
+ }
+
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPWSTR) pObjSid;
+}
+
+/******************************************************************************
* BuildTrusteeWithSidA [ADVAPI32.@]
*/
VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid)
{
- FIXME("%p %p\n", pTrustee, pSid);
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPSTR) pSid;
}
/******************************************************************************
@@ -1348,7 +1500,11 @@
*/
VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid)
{
- FIXME("%p %p\n", pTrustee, pSid);
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPWSTR) pSid;
}
/******************************************************************************
More information about the wine-patches
mailing list