diff --git a/dlls/spoolss/tests/spoolss.c b/dlls/spoolss/tests/spoolss.c index 3797785b1dc..602b9253ba6 100644 --- a/dlls/spoolss/tests/spoolss.c +++ b/dlls/spoolss/tests/spoolss.c @@ -33,6 +33,7 @@ static HMODULE hwinspool; static HMODULE hspl; +static BOOL (WINAPI * pBuildOtherNamesFromMachineName)(LPWSTR **, LPDWORD); static DWORD (WINAPI * pSplInitializeWinSpoolDrv)(LPVOID *); #define WINSPOOL_TABLESIZE 16 @@ -51,6 +52,10 @@ static LPCSTR load_functions(void) hspl = LoadLibraryA(ptr); if (!hspl) return ptr; + ptr = "BuildOtherNamesFromMachineName"; + pBuildOtherNamesFromMachineName = (void *) GetProcAddress(hspl, ptr); + if (!pBuildOtherNamesFromMachineName) return ptr; + ptr = "SplInitializeWinSpoolDrv"; pSplInitializeWinSpoolDrv = (void *) GetProcAddress(hspl, ptr); if (!pSplInitializeWinSpoolDrv) return ptr; @@ -90,6 +95,33 @@ static LPCSTR load_functions(void) /* ########################### */ +static void test_BuildOtherNamesFromMachineName(void) +{ + LPWSTR *buffers; + DWORD numentries; + DWORD res; + + buffers = NULL; + numentries = 0; + + SetLastError(0xdeadbeef); + res = pBuildOtherNamesFromMachineName(&buffers, &numentries); + + /* An array with 3 stringpointer is returned: + entry_#0: "" (empty String) + entry_#1: (this is the same as the computernam) + entry_#2: (string with the ip-address of ) + */ + todo_wine + ok( res && (buffers != NULL) && (numentries == 3) && (buffers[0] != NULL) && (buffers[0][0] == '\0'), + "got %u with %u and %p,%u (%p:%d)\n", res, GetLastError(), buffers, numentries, + ((numentries > 0) && buffers) ? buffers[0] : NULL, + ((numentries > 0) && buffers && buffers[0]) ? lstrlenW(buffers[0]) : -1); + +} + +/* ########################### */ + static void test_SplInitializeWinSpoolDrv(VOID) { DWORD res; @@ -124,6 +156,7 @@ START_TEST(spoolss) return; } + test_BuildOtherNamesFromMachineName(); test_SplInitializeWinSpoolDrv(); }