[SAMLIB]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 27 Jul 2013 14:06:53 +0000 (14:06 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 27 Jul 2013 14:06:53 +0000 (14:06 +0000)
- Implement SamGetDisplayEnumerationIndex.
- Add DOMAIN_DISPLAY_INFORMATION to ntsam.h and update sam.idl.

svn path=/trunk/; revision=59588

reactos/dll/win32/samlib/samlib.c
reactos/dll/win32/samlib/samlib.spec
reactos/include/ddk/ntsam.h
reactos/include/reactos/idl/sam.idl

index d27d9f9..78621dd 100644 (file)
@@ -870,6 +870,39 @@ SamGetCompatibilityMode(IN SAM_HANDLE ObjectHandle,
 }
 
 
+NTSTATUS
+NTAPI
+SamGetDisplayEnumerationIndex(IN SAM_HANDLE DomainHandle,
+                              IN DOMAIN_DISPLAY_INFORMATION DisplayInformation,
+                              IN PUNICODE_STRING Prefix,
+                              OUT PULONG Index)
+{
+    NTSTATUS Status;
+
+    TRACE("(%p %lu %wZ %p)\n",
+           DomainHandle, DisplayInformation, Prefix, Index);
+
+    if ((Prefix == NULL) ||
+        (Index == NULL))
+        return STATUS_INVALID_PARAMETER;
+
+    RpcTryExcept
+    {
+        Status = SamrGetDisplayEnumerationIndex2((SAMPR_HANDLE)DomainHandle,
+                                                 DisplayInformation,
+                                                 (PRPC_UNICODE_STRING)Prefix,
+                                                 Index);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        Status = I_RpcMapWin32Status(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return Status;
+}
+
+
 NTSTATUS
 NTAPI
 SamGetGroupsForUser(IN SAM_HANDLE UserHandle,
index 161ce8d..a375ecf 100644 (file)
@@ -21,7 +21,7 @@
 @ stdcall SamFreeMemory(ptr)
 @ stdcall SamGetAliasMembership(ptr long ptr ptr ptr)
 @ stdcall SamGetCompatibilityMode(ptr ptr)
-@ stub SamGetDisplayEnumerationIndex
+@ stdcall SamGetDisplayEnumerationIndex(ptr long ptr ptr)
 @ stdcall SamGetGroupsForUser(ptr ptr ptr)
 @ stdcall SamGetMembersInAlias(ptr ptr ptr)
 @ stdcall SamGetMembersInGroup(ptr ptr ptr ptr)
index 79e4f84..e9214bb 100644 (file)
@@ -298,6 +298,15 @@ typedef struct _ALIAS_ADM_COMMENT_INFORMATION
     UNICODE_STRING AdminComment;
 } ALIAS_ADM_COMMENT_INFORMATION, *PALIAS_ADM_COMMENT_INFORMATION;
 
+typedef enum _DOMAIN_DISPLAY_INFORMATION
+{
+    DomainDisplayUser = 1,
+    DomainDisplayMachine,
+    DomainDisplayGroup,
+    DomainDisplayOemUser,
+    DomainDisplayOemGroup,
+    DomainDisplayServer
+} DOMAIN_DISPLAY_INFORMATION, *PDOMAIN_DISPLAY_INFORMATION;
 
 typedef enum _DOMAIN_INFORMATION_CLASS
 {
@@ -816,6 +825,13 @@ NTAPI
 SamGetCompatibilityMode(IN SAM_HANDLE ObjectHandle,
                         OUT PULONG Mode);
 
+NTSTATUS
+NTAPI
+SamGetDisplayEnumerationIndex(IN SAM_HANDLE DomainHandle,
+                              IN DOMAIN_DISPLAY_INFORMATION DisplayInformation,
+                              IN PUNICODE_STRING Prefix,
+                              OUT PULONG Index);
+
 NTSTATUS
 NTAPI
 SamGetGroupsForUser(IN SAM_HANDLE UserHandle,
index 82c00e1..e9434ad 100644 (file)
@@ -275,14 +275,17 @@ typedef [switch_type(DOMAIN_INFORMATION_CLASS)] union _SAMPR_DOMAIN_INFO_BUFFER
     [case(DomainModifiedInformation2)] DOMAIN_MODIFIED_INFORMATION2 Modified2;
 } SAMPR_DOMAIN_INFO_BUFFER, *PSAMPR_DOMAIN_INFO_BUFFER;
 
+cpp_quote("#ifndef _NTSAM_")
 typedef enum _DOMAIN_DISPLAY_INFORMATION
 {
     DomainDisplayUser = 1,
     DomainDisplayMachine,
     DomainDisplayGroup,
     DomainDisplayOemUser,
-    DomainDisplayOemGroup
+    DomainDisplayOemGroup,
+    DomainDisplayServer
 } DOMAIN_DISPLAY_INFORMATION, *PDOMAIN_DISPLAY_INFORMATION;
+cpp_quote("#endif")
 
 typedef struct _SAMPR_DOMAIN_DISPLAY_USER
 {