From 5678f65c073f5902ff6f4b471c2357a7135dfb12 Mon Sep 17 00:00:00 2001
From: Saulius Krasuckas <saulius.krasuckas@ieee.org>
Date: Thu, 30 Jun 2005 10:23:14 +0000
Subject: [PATCH] Prepare for adding new tests. - Put OleInitialize and
 OleUninitialize in the main block. - Move test_BindToObject before
 test_EnumObjects_and_CompareIDs.

---
 dlls/shell32/tests/shlfolder.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index e74257d2630..9634481defd 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -593,8 +593,6 @@ static void test_EnumObjects_and_CompareIDs(void)
     MultiByteToWideChar(CP_ACP, 0, cCurrDirA, -1, cCurrDirW, MAX_PATH);
     strcatW(cCurrDirW, cTestDirW);
 
-    OleInitialize(NULL);
-
     hr = SHGetDesktopFolder(&IDesktopFolder);
     ok(hr == S_OK, "SHGetDesktopfolder failed %08lx\n", hr);
 
@@ -619,11 +617,16 @@ static void test_EnumObjects_and_CompareIDs(void)
 START_TEST(shlfolder)
 {
     init_function_pointers();
+    /* if OleInitialize doesn't get called, ParseDisplayName returns
+       CO_E_NOTINITIALIZED for malformed directory names on win2k. */
+    OleInitialize(NULL);
 
-    test_EnumObjects_and_CompareIDs();
     test_BindToObject();
+    test_EnumObjects_and_CompareIDs();
     test_GetDisplayName();
     test_GetAttributesOf();
     test_SHGetPathFromIDList();
     test_CallForAttributes();
+
+    OleUninitialize();
 }
-- 
GitLab