Louis Lenders : netapi32/tests: Add small conformance test for NetLocalGroupGetInfo and LocalGroupGetMembers .

Alexandre Julliard julliard at winehq.org
Wed Jun 8 11:27:03 CDT 2011


Module: wine
Branch: master
Commit: de2c4015278ee774133c7bf4c6474fe0f0060108
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=de2c4015278ee774133c7bf4c6474fe0f0060108

Author: Louis Lenders <xerox_xerox2000 at yahoo.co.uk>
Date:   Sun Jun  5 09:58:33 2011 +0200

netapi32/tests: Add small conformance test for NetLocalGroupGetInfo and LocalGroupGetMembers.

---

 dlls/netapi32/tests/access.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/dlls/netapi32/tests/access.c b/dlls/netapi32/tests/access.c
index b721c19..e8324d3 100644
--- a/dlls/netapi32/tests/access.c
+++ b/dlls/netapi32/tests/access.c
@@ -63,6 +63,8 @@ static NET_API_STATUS (WINAPI *pNetUserGetInfo)(LPCWSTR,LPCWSTR,DWORD,LPBYTE*)=N
 static NET_API_STATUS (WINAPI *pNetUserModalsGet)(LPCWSTR,DWORD,LPBYTE*)=NULL;
 static NET_API_STATUS (WINAPI *pNetUserAdd)(LPCWSTR,DWORD,LPBYTE,LPDWORD)=NULL;
 static NET_API_STATUS (WINAPI *pNetUserDel)(LPCWSTR,LPCWSTR)=NULL;
+static NET_API_STATUS (WINAPI *pNetLocalGroupGetInfo)(LPCWSTR,LPCWSTR,DWORD,LPBYTE*)=NULL;
+static NET_API_STATUS (WINAPI *pNetLocalGroupGetMembers)(LPCWSTR,LPCWSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,PDWORD_PTR)=NULL;
 
 static int init_access_tests(void)
 {
@@ -320,6 +322,31 @@ static void run_userhandling_tests(void)
     ok(ret == NERR_UserNotFound, "Deleting a nonexistent user returned 0x%08x\n",ret);
 }
 
+static void run_localgroupgetinfo_tests(void)
+{
+    NET_API_STATUS status;
+    static const WCHAR admins[] = {'A','d','m','i','n','i','s','t','r','a','t','o','r','s',0};
+    PLOCALGROUP_INFO_1 lgi = NULL;
+    PLOCALGROUP_MEMBERS_INFO_3 buffer = NULL;
+    DWORD entries_read = 0, total_entries =0;
+    int i;
+
+    status = pNetLocalGroupGetInfo(NULL, admins, 1, (LPBYTE *)&lgi);
+    ok(status == NERR_Success, "NetLocalGroupGetInfo unexpectedly returned %d\n", status);
+
+    trace("Local groupname:%s\n", wine_dbgstr_w( lgi->lgrpi1_name));
+    trace("Comment: %s\n", wine_dbgstr_w( lgi->lgrpi1_comment));
+
+    pNetApiBufferFree(lgi);
+
+    status = pNetLocalGroupGetMembers(NULL, admins, 3, (LPBYTE *)&buffer, MAX_PREFERRED_LENGTH, &entries_read, &total_entries, NULL);
+    ok(status == NERR_Success, "NetLocalGroupGetMembers unexpectedly returned %d\n", status);
+    ok(entries_read > 0 && total_entries > 0, "Amount of entries is unexpectedly 0\n");
+
+    for(i=0;i<entries_read;i++)
+        trace("domain and name: %s\n", wine_dbgstr_w(buffer[i].lgrmi3_domainandname));
+}
+
 START_TEST(access)
 {
     HMODULE hnetapi32=LoadLibraryA("netapi32.dll");
@@ -331,6 +358,8 @@ START_TEST(access)
     pNetUserModalsGet=(void*)GetProcAddress(hnetapi32,"NetUserModalsGet");
     pNetUserAdd=(void*)GetProcAddress(hnetapi32, "NetUserAdd");
     pNetUserDel=(void*)GetProcAddress(hnetapi32, "NetUserDel");
+    pNetLocalGroupGetInfo=(void*)GetProcAddress(hnetapi32, "NetLocalGroupGetInfo");
+    pNetLocalGroupGetMembers=(void*)GetProcAddress(hnetapi32, "NetLocalGroupGetMembers");
 
     /* These functions were introduced with NT. It's safe to assume that
      * if one is not available, none are.
@@ -346,6 +375,7 @@ START_TEST(access)
         run_usergetinfo_tests();
         run_querydisplayinformation1_tests();
         run_usermodalsget_tests();
+        run_localgroupgetinfo_tests();
     }
 
     FreeLibrary(hnetapi32);




More information about the wine-cvs mailing list