user32: Add a test that shows ddeml string handles use local atoms.

This commit is contained in:
James Hawkins 2007-09-19 23:37:49 -05:00 committed by Alexandre Julliard
parent 8e90c6099e
commit c8fb8c0201
1 changed files with 24 additions and 0 deletions

View File

@ -302,6 +302,7 @@ static void test_DdeCreateStringHandleW(DWORD dde_inst, int codepage)
HSZ str_handle;
WCHAR bufW[256];
char buf[256];
ATOM atom;
int ret;
str_handle = DdeCreateStringHandleW(dde_inst, dde_string, codepage);
@ -350,6 +351,29 @@ static void test_DdeCreateStringHandleW(DWORD dde_inst, int codepage)
ok(!lstrcmpW(dde_string, (LPCWSTR)buf), "DdeQueryStringW returned wrong string\n");
}
if (codepage == CP_WINANSI)
{
atom = FindAtomA((LPSTR)dde_string);
ok(atom != 0, "Expected a valid atom\n");
SetLastError(0xdeadbeef);
atom = GlobalFindAtomA((LPSTR)dde_string);
ok(atom == 0, "Expected 0, got %d\n", atom);
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
}
else
{
atom = FindAtomW(dde_string);
ok(atom != 0, "Expected a valid atom\n");
SetLastError(0xdeadbeef);
atom = GlobalFindAtomW(dde_string);
ok(atom == 0, "Expected 0, got %d\n", atom);
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
}
ok(DdeFreeStringHandle(dde_inst, str_handle), "DdeFreeStringHandle failed\n");
}