Commit 114e8485 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shlwapi: Added SHPackDispParams test.

parent dabbe5c5
......@@ -23,6 +23,8 @@
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "ole2.h"
#include "oaidl.h"
/* Function ptrs for ordinal calls */
static HMODULE hShlwapi;
......@@ -33,6 +35,7 @@ static HANDLE (WINAPI *pSHAllocShared)(LPCVOID,DWORD,DWORD);
static LPVOID (WINAPI *pSHLockShared)(HANDLE,DWORD);
static BOOL (WINAPI *pSHUnlockShared)(LPVOID);
static BOOL (WINAPI *pSHFreeShared)(HANDLE,DWORD);
static HRESULT(WINAPIV *pSHPackDispParams)(DISPPARAMS*,VARIANTARG*,UINT,...);
static void test_GetAcceptLanguagesA(void)
{ HRESULT retval;
......@@ -431,6 +434,53 @@ static void test_GetShellSecurityDescriptor(void)
}
}
static void test_SHPackDispParams(void)
{
DISPPARAMS params;
VARIANT vars[10];
HRESULT hres;
if(!pSHPackDispParams)
skip("SHPackSidpParams not available\n");
memset(&params, 0xc0, sizeof(params));
memset(vars, 0xc0, sizeof(vars));
hres = pSHPackDispParams(&params, vars, 1, VT_I4, 0xdeadbeef);
ok(hres == S_OK, "SHPackDispParams failed: %08x\n", hres);
ok(params.cArgs == 1, "params.cArgs = %d\n", params.cArgs);
ok(params.cNamedArgs == 0, "params.cNamedArgs = %d\n", params.cArgs);
ok(params.rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", params.rgdispidNamedArgs);
ok(params.rgvarg == vars, "params.rgvarg = %p\n", params.rgvarg);
ok(V_VT(vars) == VT_I4, "V_VT(var) = %d\n", V_VT(vars));
ok(V_DISPATCH(vars) == (void*)0xdeadbeef, "failed\n");
memset(&params, 0xc0, sizeof(params));
hres = pSHPackDispParams(&params, NULL, 0, 0);
ok(hres == S_OK, "SHPackDispParams failed: %08x\n", hres);
ok(params.cArgs == 0, "params.cArgs = %d\n", params.cArgs);
ok(params.cNamedArgs == 0, "params.cNamedArgs = %d\n", params.cArgs);
ok(params.rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", params.rgdispidNamedArgs);
ok(params.rgvarg == NULL, "params.rgvarg = %p\n", params.rgvarg);
memset(vars, 0xc0, sizeof(vars));
memset(&params, 0xc0, sizeof(params));
hres = pSHPackDispParams(&params, vars, 4, VT_BSTR, (void*)0xdeadbeef, VT_EMPTY, 10,
VT_I4, 100, VT_DISPATCH, (void*)0xdeadbeef);
ok(hres == S_OK, "SHPackDispParams failed: %08x\n", hres);
ok(params.cArgs == 4, "params.cArgs = %d\n", params.cArgs);
ok(params.cNamedArgs == 0, "params.cNamedArgs = %d\n", params.cArgs);
ok(params.rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", params.rgdispidNamedArgs);
ok(params.rgvarg == vars, "params.rgvarg = %p\n", params.rgvarg);
ok(V_VT(vars) == VT_DISPATCH, "V_VT(vars[0]) = %x\n", V_VT(vars));
ok(V_I4(vars) == 0xdeadbeef, "V_I4(vars[0]) = %x\n", V_I4(vars));
ok(V_VT(vars+1) == VT_I4, "V_VT(vars[1]) = %d\n", V_VT(vars+1));
ok(V_I4(vars+1) == 100, "V_I4(vars[1]) = %x\n", V_I4(vars+1));
ok(V_VT(vars+2) == VT_I4, "V_VT(vars[2]) = %d\n", V_VT(vars+2));
ok(V_I4(vars+2) == 10, "V_I4(vars[2]) = %x\n", V_I4(vars+2));
ok(V_VT(vars+3) == VT_BSTR, "V_VT(vars[3]) = %d\n", V_VT(vars+3));
ok(V_BSTR(vars+3) == (void*)0xdeadbeef, "V_BSTR(vars[3]) = %p\n", V_BSTR(vars+3));
}
START_TEST(ordinal)
{
hShlwapi = GetModuleHandleA("shlwapi.dll");
......@@ -441,10 +491,12 @@ START_TEST(ordinal)
pSHLockShared=(void*)GetProcAddress(hShlwapi,(char*)8);
pSHUnlockShared=(void*)GetProcAddress(hShlwapi,(char*)9);
pSHFreeShared=(void*)GetProcAddress(hShlwapi,(char*)10);
pSHPackDispParams=(void*)GetProcAddress(hShlwapi,(char*)282);
test_GetAcceptLanguagesA();
test_SHSearchMapInt();
test_alloc_shared();
test_fdsa();
test_GetShellSecurityDescriptor();
test_SHPackDispParams();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment