From 149e4a8bed9d595d3afb7b59ce0e38d29c87af9f Mon Sep 17 00:00:00 2001
From: Bruno Jesus <00cpxxx@gmail.com>
Date: Wed, 25 Nov 2015 16:02:56 +0800
Subject: [PATCH] shlwapi/tests: Test NULL handle duplication in SHMapHandle()

---
 dlls/shlwapi/tests/ordinal.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c
index 68526cd..3aed12a 100644
--- a/dlls/shlwapi/tests/ordinal.c
+++ b/dlls/shlwapi/tests/ordinal.c
@@ -545,6 +545,12 @@ static void test_alloc_shared_remote(DWORD procid, HANDLE hmem)
     ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
 
     /* test SHMapHandle */
+    SetLastError(0xdeadbeef);
+    hmem2 = pSHMapHandle(NULL, procid, GetCurrentProcessId(), 0, 0);
+    ok(hmem2 == NULL, "expected NULL, got new handle\n", hmem2);
+todo_wine
+    ok(GetLastError() == 0xdeadbeef, "last error should not have changed, got %d\n", GetLastError());
+
     hmem2 = pSHMapHandle(hmem, procid, GetCurrentProcessId(), 0, 0);
 
     /* It seems like Windows Vista/2008 uses a different internal implementation
-- 
2.1.4

