From 8d5e5e74a1531ca13af0e64269e496ee6dbaad09 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Wed, 11 Nov 2009 09:09:29 +0100 Subject: [PATCH] shell32/tests: Run tests again on NT4. --- dlls/shell32/tests/progman_dde.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/tests/progman_dde.c b/dlls/shell32/tests/progman_dde.c index 36ce835b90e..e4867e1a986 100644 --- a/dlls/shell32/tests/progman_dde.c +++ b/dlls/shell32/tests/progman_dde.c @@ -59,6 +59,16 @@ #define DDE_TEST_NUMMASK 0x0000ffff +static BOOL (WINAPI *pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL); + +static void init_function_pointers(void) +{ + HMODULE hmod; + + hmod = GetModuleHandleA("shell32.dll"); + pSHGetSpecialFolderPathA = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathA"); +} + static HDDEDATA CALLBACK DdeCallback(UINT type, UINT format, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hDDEData, ULONG_PTR data1, ULONG_PTR data2) { @@ -233,6 +243,9 @@ static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldEx DWORD attributes; int len; + if (!pSHGetSpecialFolderPathA) + return; + path = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); if (path != NULL) { @@ -243,13 +256,13 @@ static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldEx if (testParams & DDE_TEST_COMMON) { specialFolder = CSIDL_COMMON_PROGRAMS; - err = SHGetSpecialFolderPath(NULL, path, specialFolder, FALSE); + err = pSHGetSpecialFolderPathA(NULL, path, specialFolder, FALSE); /* Win 9x fails, use CSIDL_PROGRAMS (err == FALSE) */ } if (err == FALSE) { specialFolder = CSIDL_PROGRAMS; - err = SHGetSpecialFolderPath(NULL, path, specialFolder, FALSE); + err = pSHGetSpecialFolderPathA(NULL, path, specialFolder, FALSE); } len = strlen(path) + strlen(nameToCheck)+1; if (groupName != NULL) @@ -526,6 +539,12 @@ START_TEST(progman_dde) HCONV hConv; int testnum; + init_function_pointers(); + + /* Only report this once */ + if (!pSHGetSpecialFolderPathA) + win_skip("SHGetSpecialFolderPathA is not available\n"); + /* Initialize DDE Instance */ err = DdeInitialize(&instance, DdeCallback, APPCMD_CLIENTONLY, 0); ok (err == DMLERR_NO_ERROR, "DdeInitialize Error %s\n", GetStringFromError(err));