mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 04:37:15 +00:00
- Import rpcrt4 tests from Wine-20080105.
- There is an ugly hack applied, which defines the relative path to the server_*.h files inside obj-i386 directory, thus being dependent on its name. svn path=/trunk/; revision=31710
This commit is contained in:
parent
8f381d925f
commit
f1df2b6693
10 changed files with 5199 additions and 0 deletions
|
@ -62,6 +62,9 @@
|
|||
<directory name="riched20">
|
||||
<xi:include href="riched20/riched20.rbuild" />
|
||||
</directory>
|
||||
<directory name="rpcrt4">
|
||||
<xi:include href="rpcrt4/rpcrt4.rbuild" />
|
||||
</directory>
|
||||
<directory name="rsabase">
|
||||
<xi:include href="rsabase/rsabase.rbuild" />
|
||||
</directory>
|
||||
|
|
945
rostests/winetests/rpcrt4/cstub.c
Normal file
945
rostests/winetests/rpcrt4/cstub.c
Normal file
|
@ -0,0 +1,945 @@
|
|||
/*
|
||||
* Unit test suite for cstubs
|
||||
*
|
||||
* Copyright 2006 Huw Davies
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define PROXY_DELEGATION
|
||||
#define COBJMACROS
|
||||
|
||||
#include "wine/test.h"
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winnt.h>
|
||||
#include <winerror.h>
|
||||
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcdce.h"
|
||||
#include "rpcproxy.h"
|
||||
|
||||
static CStdPSFactoryBuffer PSFactoryBuffer;
|
||||
|
||||
CSTDSTUBBUFFERRELEASE(&PSFactoryBuffer)
|
||||
CSTDSTUBBUFFER2RELEASE(&PSFactoryBuffer)
|
||||
|
||||
static GUID IID_if1 = {0x12345678, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
|
||||
static GUID IID_if2 = {0x12345679, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
|
||||
static GUID IID_if3 = {0x1234567a, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
|
||||
static GUID IID_if4 = {0x1234567b, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
|
||||
|
||||
static int my_alloc_called;
|
||||
static int my_free_called;
|
||||
|
||||
static void * CALLBACK my_alloc(size_t size)
|
||||
{
|
||||
my_alloc_called++;
|
||||
return NdrOleAllocate(size);
|
||||
}
|
||||
|
||||
static void CALLBACK my_free(void *ptr)
|
||||
{
|
||||
my_free_called++;
|
||||
NdrOleFree(ptr);
|
||||
}
|
||||
|
||||
typedef struct _MIDL_PROC_FORMAT_STRING
|
||||
{
|
||||
short Pad;
|
||||
unsigned char Format[ 2 ];
|
||||
} MIDL_PROC_FORMAT_STRING;
|
||||
|
||||
typedef struct _MIDL_TYPE_FORMAT_STRING
|
||||
{
|
||||
short Pad;
|
||||
unsigned char Format[ 2 ];
|
||||
} MIDL_TYPE_FORMAT_STRING;
|
||||
|
||||
|
||||
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
|
||||
{
|
||||
0,
|
||||
{
|
||||
0, 0
|
||||
}
|
||||
};
|
||||
|
||||
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
|
||||
{
|
||||
0,
|
||||
{
|
||||
0, 0
|
||||
}
|
||||
};
|
||||
|
||||
static const MIDL_STUB_DESC Object_StubDesc =
|
||||
{
|
||||
NULL,
|
||||
my_alloc,
|
||||
my_free,
|
||||
{ 0 },
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__MIDL_TypeFormatString.Format,
|
||||
1, /* -error bounds_check flag */
|
||||
0x20000, /* Ndr library version */
|
||||
0,
|
||||
0x50100a4, /* MIDL Version 5.1.164 */
|
||||
0,
|
||||
NULL,
|
||||
0, /* notify & notify_flag routine table */
|
||||
1, /* Flags */
|
||||
0, /* Reserved3 */
|
||||
0, /* Reserved4 */
|
||||
0 /* Reserved5 */
|
||||
};
|
||||
|
||||
static HRESULT WINAPI if1_fn1_Proxy(void *This)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void __RPC_STUB if1_fn1_Stub(
|
||||
IRpcStubBuffer *This,
|
||||
IRpcChannelBuffer *_pRpcChannelBuffer,
|
||||
PRPC_MESSAGE _pRpcMessage,
|
||||
DWORD *_pdwStubPhase)
|
||||
{
|
||||
trace("fn1 stub\n");
|
||||
}
|
||||
|
||||
static HRESULT WINAPI if1_fn2_Proxy(void *This)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void __RPC_STUB if1_fn2_Stub(
|
||||
IRpcStubBuffer *This,
|
||||
IRpcChannelBuffer *_pRpcChannelBuffer,
|
||||
PRPC_MESSAGE _pRpcMessage,
|
||||
DWORD *_pdwStubPhase)
|
||||
{
|
||||
trace("fn2 stub\n");
|
||||
}
|
||||
|
||||
static CINTERFACE_PROXY_VTABLE(5) if1_proxy_vtbl =
|
||||
{
|
||||
{ &IID_if1 },
|
||||
{ IUnknown_QueryInterface_Proxy,
|
||||
IUnknown_AddRef_Proxy,
|
||||
IUnknown_Release_Proxy ,
|
||||
if1_fn1_Proxy,
|
||||
if1_fn2_Proxy
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static const unsigned short if1_FormatStringOffsetTable[] =
|
||||
{
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static const MIDL_SERVER_INFO if1_server_info =
|
||||
{
|
||||
&Object_StubDesc,
|
||||
0,
|
||||
__MIDL_ProcFormatString.Format,
|
||||
&if1_FormatStringOffsetTable[-3],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
|
||||
|
||||
static const PRPC_STUB_FUNCTION if1_table[] =
|
||||
{
|
||||
if1_fn1_Stub,
|
||||
if1_fn2_Stub
|
||||
};
|
||||
|
||||
static CInterfaceStubVtbl if1_stub_vtbl =
|
||||
{
|
||||
{
|
||||
&IID_if1,
|
||||
&if1_server_info,
|
||||
5,
|
||||
&if1_table[-3]
|
||||
},
|
||||
{ CStdStubBuffer_METHODS }
|
||||
};
|
||||
|
||||
static CINTERFACE_PROXY_VTABLE(13) if2_proxy_vtbl =
|
||||
{
|
||||
{ &IID_if2 },
|
||||
{ IUnknown_QueryInterface_Proxy,
|
||||
IUnknown_AddRef_Proxy,
|
||||
IUnknown_Release_Proxy ,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
}
|
||||
};
|
||||
|
||||
static const unsigned short if2_FormatStringOffsetTable[] =
|
||||
{
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
0
|
||||
};
|
||||
|
||||
static const MIDL_SERVER_INFO if2_server_info =
|
||||
{
|
||||
&Object_StubDesc,
|
||||
0,
|
||||
__MIDL_ProcFormatString.Format,
|
||||
&if2_FormatStringOffsetTable[-3],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
|
||||
|
||||
static const PRPC_STUB_FUNCTION if2_table[] =
|
||||
{
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION
|
||||
};
|
||||
|
||||
static CInterfaceStubVtbl if2_stub_vtbl =
|
||||
{
|
||||
{
|
||||
&IID_if2,
|
||||
&if2_server_info,
|
||||
13,
|
||||
&if2_table[-3]
|
||||
},
|
||||
{ CStdStubBuffer_DELEGATING_METHODS }
|
||||
};
|
||||
|
||||
static CINTERFACE_PROXY_VTABLE(4) if3_proxy_vtbl =
|
||||
{
|
||||
{ &IID_if3 },
|
||||
{ IUnknown_QueryInterface_Proxy,
|
||||
IUnknown_AddRef_Proxy,
|
||||
IUnknown_Release_Proxy ,
|
||||
if1_fn1_Proxy
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static const unsigned short if3_FormatStringOffsetTable[] =
|
||||
{
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static const MIDL_SERVER_INFO if3_server_info =
|
||||
{
|
||||
&Object_StubDesc,
|
||||
0,
|
||||
__MIDL_ProcFormatString.Format,
|
||||
&if3_FormatStringOffsetTable[-3],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
|
||||
|
||||
static const PRPC_STUB_FUNCTION if3_table[] =
|
||||
{
|
||||
if1_fn1_Stub
|
||||
};
|
||||
|
||||
static CInterfaceStubVtbl if3_stub_vtbl =
|
||||
{
|
||||
{
|
||||
&IID_if3,
|
||||
&if3_server_info,
|
||||
4,
|
||||
&if1_table[-3]
|
||||
},
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static CINTERFACE_PROXY_VTABLE(7) if4_proxy_vtbl =
|
||||
{
|
||||
{ &IID_if4 },
|
||||
{ IUnknown_QueryInterface_Proxy,
|
||||
IUnknown_AddRef_Proxy,
|
||||
IUnknown_Release_Proxy ,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
}
|
||||
};
|
||||
|
||||
static const unsigned short if4_FormatStringOffsetTable[] =
|
||||
{
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
0
|
||||
};
|
||||
|
||||
static const MIDL_SERVER_INFO if4_server_info =
|
||||
{
|
||||
&Object_StubDesc,
|
||||
0,
|
||||
__MIDL_ProcFormatString.Format,
|
||||
&if4_FormatStringOffsetTable[-3],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
|
||||
|
||||
static const PRPC_STUB_FUNCTION if4_table[] =
|
||||
{
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
};
|
||||
|
||||
static CInterfaceStubVtbl if4_stub_vtbl =
|
||||
{
|
||||
{
|
||||
&IID_if4,
|
||||
&if4_server_info,
|
||||
7,
|
||||
&if2_table[-3]
|
||||
},
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const CInterfaceProxyVtbl *cstub_ProxyVtblList[] =
|
||||
{
|
||||
(const CInterfaceProxyVtbl *) &if1_proxy_vtbl,
|
||||
(const CInterfaceProxyVtbl *) &if2_proxy_vtbl,
|
||||
(const CInterfaceProxyVtbl *) &if3_proxy_vtbl,
|
||||
(const CInterfaceProxyVtbl *) &if4_proxy_vtbl,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const CInterfaceStubVtbl *cstub_StubVtblList[] =
|
||||
{
|
||||
(const CInterfaceStubVtbl *) &if1_stub_vtbl,
|
||||
(const CInterfaceStubVtbl *) &if2_stub_vtbl,
|
||||
(const CInterfaceStubVtbl *) &if3_stub_vtbl,
|
||||
(const CInterfaceStubVtbl *) &if4_stub_vtbl,
|
||||
NULL
|
||||
};
|
||||
|
||||
static PCInterfaceName const if_name_list[] =
|
||||
{
|
||||
"if1",
|
||||
"if2",
|
||||
"if3",
|
||||
"if4",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const IID *base_iid_list[] =
|
||||
{
|
||||
NULL,
|
||||
&IID_ITypeLib,
|
||||
NULL,
|
||||
&IID_IDispatch,
|
||||
NULL
|
||||
};
|
||||
|
||||
#define cstub_CHECK_IID(n) IID_GENERIC_CHECK_IID( cstub, pIID, n)
|
||||
|
||||
static int __stdcall iid_lookup( const IID * pIID, int * pIndex )
|
||||
{
|
||||
IID_BS_LOOKUP_SETUP
|
||||
|
||||
IID_BS_LOOKUP_INITIAL_TEST( cstub, 4, 4 )
|
||||
IID_BS_LOOKUP_NEXT_TEST( cstub, 2 )
|
||||
IID_BS_LOOKUP_NEXT_TEST( cstub, 1 )
|
||||
IID_BS_LOOKUP_RETURN_RESULT( cstub, 4, *pIndex )
|
||||
|
||||
}
|
||||
|
||||
|
||||
static const ExtendedProxyFileInfo my_proxy_file_info =
|
||||
{
|
||||
(const PCInterfaceProxyVtblList *) &cstub_ProxyVtblList,
|
||||
(const PCInterfaceStubVtblList *) &cstub_StubVtblList,
|
||||
(const PCInterfaceName *) &if_name_list,
|
||||
(const IID **) &base_iid_list,
|
||||
&iid_lookup,
|
||||
4,
|
||||
1,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static const ProxyFileInfo *proxy_file_list[] = {
|
||||
&my_proxy_file_info,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static IPSFactoryBuffer *test_NdrDllGetClassObject(void)
|
||||
{
|
||||
IPSFactoryBuffer *ppsf = NULL;
|
||||
const CLSID PSDispatch = {0x20420, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}};
|
||||
HRESULT r;
|
||||
HMODULE hmod = LoadLibraryA("rpcrt4.dll");
|
||||
void *CStd_QueryInterface = GetProcAddress(hmod, "CStdStubBuffer_QueryInterface");
|
||||
void *CStd_AddRef = GetProcAddress(hmod, "CStdStubBuffer_AddRef");
|
||||
void *CStd_Release = GetProcAddress(hmod, "NdrCStdStubBuffer_Release");
|
||||
void *CStd_Connect = GetProcAddress(hmod, "CStdStubBuffer_Connect");
|
||||
void *CStd_Disconnect = GetProcAddress(hmod, "CStdStubBuffer_Disconnect");
|
||||
void *CStd_Invoke = GetProcAddress(hmod, "CStdStubBuffer_Invoke");
|
||||
void *CStd_IsIIDSupported = GetProcAddress(hmod, "CStdStubBuffer_IsIIDSupported");
|
||||
void *CStd_CountRefs = GetProcAddress(hmod, "CStdStubBuffer_CountRefs");
|
||||
void *CStd_DebugServerQueryInterface = GetProcAddress(hmod, "CStdStubBuffer_DebugServerQueryInterface");
|
||||
void *CStd_DebugServerRelease = GetProcAddress(hmod, "CStdStubBuffer_DebugServerRelease");
|
||||
|
||||
r = NdrDllGetClassObject(&PSDispatch, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
|
||||
&PSDispatch, &PSFactoryBuffer);
|
||||
|
||||
ok(r == S_OK, "ret %08x\n", r);
|
||||
ok(ppsf != NULL, "ppsf == NULL\n");
|
||||
|
||||
ok(PSFactoryBuffer.pProxyFileList == proxy_file_list, "pfl not the same\n");
|
||||
ok(PSFactoryBuffer.pProxyFileList[0]->pStubVtblList == (PCInterfaceStubVtblList *) &cstub_StubVtblList, "stub vtbllist not the same\n");
|
||||
|
||||
/* if1 is non-delegating, if2 is delegating, if3 is non-delegating
|
||||
but I've zero'ed the vtbl entries, similarly if4 is delegating
|
||||
with zero'ed vtbl entries */
|
||||
|
||||
#define VTBL_TEST_NOT_CHANGE_TO(name, i) \
|
||||
ok(PSFactoryBuffer.pProxyFileList[0]->pStubVtblList[i]->Vtbl.name != CStd_##name, #name "vtbl %d updated %p %p\n", \
|
||||
i, PSFactoryBuffer.pProxyFileList[0]->pStubVtblList[i]->Vtbl.name, CStd_##name );
|
||||
#define VTBL_TEST_CHANGE_TO(name, i) \
|
||||
ok(PSFactoryBuffer.pProxyFileList[0]->pStubVtblList[i]->Vtbl.name == CStd_##name, #name "vtbl %d not updated %p %p\n", \
|
||||
i, PSFactoryBuffer.pProxyFileList[0]->pStubVtblList[i]->Vtbl.name, CStd_##name );
|
||||
#define VTBL_TEST_ZERO(name, i) \
|
||||
ok(PSFactoryBuffer.pProxyFileList[0]->pStubVtblList[i]->Vtbl.name == NULL, #name "vtbl %d not null %p\n", \
|
||||
i, PSFactoryBuffer.pProxyFileList[0]->pStubVtblList[i]->Vtbl.name );
|
||||
VTBL_TEST_NOT_CHANGE_TO(QueryInterface, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(AddRef, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Release, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Connect, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Disconnect, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Invoke, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(IsIIDSupported, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(CountRefs, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(DebugServerQueryInterface, 0);
|
||||
VTBL_TEST_NOT_CHANGE_TO(DebugServerRelease, 0);
|
||||
|
||||
VTBL_TEST_CHANGE_TO(QueryInterface, 1);
|
||||
VTBL_TEST_CHANGE_TO(AddRef, 1);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Release, 1);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Connect, 1);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Disconnect, 1);
|
||||
VTBL_TEST_CHANGE_TO(Invoke, 1);
|
||||
VTBL_TEST_CHANGE_TO(IsIIDSupported, 1);
|
||||
VTBL_TEST_NOT_CHANGE_TO(CountRefs, 1);
|
||||
VTBL_TEST_CHANGE_TO(DebugServerQueryInterface, 1);
|
||||
VTBL_TEST_CHANGE_TO(DebugServerRelease, 1);
|
||||
|
||||
VTBL_TEST_CHANGE_TO(QueryInterface, 2);
|
||||
VTBL_TEST_CHANGE_TO(AddRef, 2);
|
||||
VTBL_TEST_ZERO(Release, 2);
|
||||
VTBL_TEST_CHANGE_TO(Connect, 2);
|
||||
VTBL_TEST_CHANGE_TO(Disconnect, 2);
|
||||
VTBL_TEST_CHANGE_TO(Invoke, 2);
|
||||
VTBL_TEST_CHANGE_TO(IsIIDSupported, 2);
|
||||
VTBL_TEST_CHANGE_TO(CountRefs, 2);
|
||||
VTBL_TEST_CHANGE_TO(DebugServerQueryInterface, 2);
|
||||
VTBL_TEST_CHANGE_TO(DebugServerRelease, 2);
|
||||
|
||||
VTBL_TEST_CHANGE_TO(QueryInterface, 3);
|
||||
VTBL_TEST_CHANGE_TO(AddRef, 3);
|
||||
VTBL_TEST_ZERO(Release, 3);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Connect, 3);
|
||||
VTBL_TEST_NOT_CHANGE_TO(Disconnect, 3);
|
||||
VTBL_TEST_CHANGE_TO(Invoke, 3);
|
||||
VTBL_TEST_CHANGE_TO(IsIIDSupported, 3);
|
||||
VTBL_TEST_NOT_CHANGE_TO(CountRefs, 3);
|
||||
VTBL_TEST_CHANGE_TO(DebugServerQueryInterface, 3);
|
||||
VTBL_TEST_CHANGE_TO(DebugServerRelease, 3);
|
||||
|
||||
|
||||
|
||||
#undef VTBL_TEST_NOT_CHANGE_TO
|
||||
#undef VTBL_TEST_CHANGE_TO
|
||||
#undef VTBL_TEST_ZERO
|
||||
|
||||
ok(PSFactoryBuffer.RefCount == 1, "ref count %d\n", PSFactoryBuffer.RefCount);
|
||||
return ppsf;
|
||||
}
|
||||
|
||||
static int base_buffer_invoke_called;
|
||||
static HRESULT WINAPI base_buffer_Invoke(IRpcStubBuffer *This, RPCOLEMESSAGE *msg, IRpcChannelBuffer *channel)
|
||||
{
|
||||
base_buffer_invoke_called++;
|
||||
ok(msg == (RPCOLEMESSAGE*)0xcafebabe, "msg ptr changed\n");
|
||||
ok(channel == (IRpcChannelBuffer*)0xdeadbeef, "channel ptr changed\n");
|
||||
return S_OK; /* returning any failure here results in an exception */
|
||||
}
|
||||
|
||||
static IRpcStubBufferVtbl base_buffer_vtbl = {
|
||||
(void*)0xcafebab0,
|
||||
(void*)0xcafebab1,
|
||||
(void*)0xcafebab2,
|
||||
(void*)0xcafebab3,
|
||||
(void*)0xcafebab4,
|
||||
base_buffer_Invoke,
|
||||
(void*)0xcafebab6,
|
||||
(void*)0xcafebab7,
|
||||
(void*)0xcafebab8,
|
||||
(void*)0xcafebab9
|
||||
};
|
||||
|
||||
static void test_NdrStubForwardingFunction(void)
|
||||
{
|
||||
void *This[5];
|
||||
void *real_this;
|
||||
IRpcChannelBuffer *channel = (IRpcChannelBuffer*)0xdeadbeef;
|
||||
RPC_MESSAGE *msg = (RPC_MESSAGE*)0xcafebabe;
|
||||
DWORD *phase = (DWORD*)0x12345678;
|
||||
IRpcStubBufferVtbl *base_buffer_vtbl_ptr = &base_buffer_vtbl;
|
||||
IRpcStubBuffer *base_stub_buffer = (IRpcStubBuffer*)&base_buffer_vtbl_ptr;
|
||||
|
||||
memset(This, 0xcc, sizeof(This));
|
||||
This[0] = base_stub_buffer;
|
||||
real_this = &This[1];
|
||||
|
||||
NdrStubForwardingFunction( real_this, channel, msg, phase );
|
||||
ok(base_buffer_invoke_called == 1, "base_buffer_invoke called %d times\n", base_buffer_invoke_called);
|
||||
|
||||
}
|
||||
|
||||
static IRpcStubBuffer *create_stub(IPSFactoryBuffer *ppsf, REFIID iid, IUnknown *obj, HRESULT expected_result)
|
||||
{
|
||||
IRpcStubBuffer *pstub = NULL;
|
||||
HRESULT r;
|
||||
|
||||
r = IPSFactoryBuffer_CreateStub(ppsf, iid, obj, &pstub);
|
||||
ok(r == expected_result, "CreateStub returned %08x expected %08x\n", r, expected_result);
|
||||
return pstub;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI create_stub_test_QI(IUnknown *This, REFIID iid, void **ppv)
|
||||
{
|
||||
ok(IsEqualIID(iid, &IID_if1), "incorrect iid\n");
|
||||
*ppv = (void*)0xdeadbeef;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static IUnknownVtbl create_stub_test_vtbl =
|
||||
{
|
||||
create_stub_test_QI,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static HRESULT WINAPI create_stub_test_fail_QI(IUnknown *This, REFIID iid, void **ppv)
|
||||
{
|
||||
ok(IsEqualIID(iid, &IID_if1), "incorrect iid\n");
|
||||
*ppv = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static IUnknownVtbl create_stub_test_fail_vtbl =
|
||||
{
|
||||
create_stub_test_fail_QI,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static void test_CreateStub(IPSFactoryBuffer *ppsf)
|
||||
{
|
||||
IUnknownVtbl *vtbl = &create_stub_test_vtbl;
|
||||
IUnknown *obj = (IUnknown*)&vtbl;
|
||||
IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
|
||||
CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
|
||||
const CInterfaceStubHeader *header = ((const CInterfaceStubHeader *)cstd_stub->lpVtbl) - 1;
|
||||
|
||||
ok(IsEqualIID(header->piid, &IID_if1), "header iid differs\n");
|
||||
ok(cstd_stub->RefCount == 1, "ref count %d\n", cstd_stub->RefCount);
|
||||
/* 0xdeadbeef returned from create_stub_test_QI */
|
||||
ok(cstd_stub->pvServerObject == (void*)0xdeadbeef, "pvServerObject %p\n", cstd_stub->pvServerObject);
|
||||
ok(cstd_stub->pPSFactory == ppsf, "pPSFactory %p\n", cstd_stub->pPSFactory);
|
||||
|
||||
vtbl = &create_stub_test_fail_vtbl;
|
||||
pstub = create_stub(ppsf, &IID_if1, obj, E_NOINTERFACE);
|
||||
|
||||
}
|
||||
|
||||
static HRESULT WINAPI connect_test_orig_QI(IUnknown *This, REFIID iid, void **ppv)
|
||||
{
|
||||
ok(IsEqualIID(iid, &IID_if1) ||
|
||||
IsEqualIID(iid, &IID_if2), "incorrect iid\n");
|
||||
*ppv = (void*)This;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static int connect_test_orig_release_called;
|
||||
static ULONG WINAPI connect_test_orig_release(IUnknown *This)
|
||||
{
|
||||
connect_test_orig_release_called++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static IUnknownVtbl connect_test_orig_vtbl =
|
||||
{
|
||||
connect_test_orig_QI,
|
||||
NULL,
|
||||
connect_test_orig_release
|
||||
};
|
||||
|
||||
static HRESULT WINAPI connect_test_new_QI(IUnknown *This, REFIID iid, void **ppv)
|
||||
{
|
||||
ok(IsEqualIID(iid, &IID_if1) ||
|
||||
IsEqualIID(iid, &IID_if2), "incorrect iid\n");
|
||||
*ppv = (void*)0xcafebabe;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static IUnknownVtbl connect_test_new_vtbl =
|
||||
{
|
||||
connect_test_new_QI,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static HRESULT WINAPI connect_test_new_fail_QI(IUnknown *This, REFIID iid, void **ppv)
|
||||
{
|
||||
ok(IsEqualIID(iid, &IID_if1), "incorrect iid\n");
|
||||
*ppv = (void*)0xdeadbeef;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static IUnknownVtbl connect_test_new_fail_vtbl =
|
||||
{
|
||||
connect_test_new_fail_QI,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int connect_test_base_Connect_called;
|
||||
static HRESULT WINAPI connect_test_base_Connect(IRpcStubBuffer *pstub, IUnknown *obj)
|
||||
{
|
||||
connect_test_base_Connect_called++;
|
||||
ok(*(void**)obj == (void*)0xbeefcafe, "unexpected obj %p\n", obj);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static IRpcStubBufferVtbl connect_test_base_stub_buffer_vtbl =
|
||||
{
|
||||
(void*)0xcafebab0,
|
||||
(void*)0xcafebab1,
|
||||
(void*)0xcafebab2,
|
||||
connect_test_base_Connect,
|
||||
(void*)0xcafebab4,
|
||||
(void*)0xcafebab5,
|
||||
(void*)0xcafebab6,
|
||||
(void*)0xcafebab7,
|
||||
(void*)0xcafebab8,
|
||||
(void*)0xcafebab9
|
||||
};
|
||||
|
||||
static void test_Connect(IPSFactoryBuffer *ppsf)
|
||||
{
|
||||
IUnknownVtbl *orig_vtbl = &connect_test_orig_vtbl;
|
||||
IUnknownVtbl *new_vtbl = &connect_test_new_vtbl;
|
||||
IUnknownVtbl *new_fail_vtbl = &connect_test_new_fail_vtbl;
|
||||
IUnknown *obj = (IUnknown*)&orig_vtbl;
|
||||
IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
|
||||
CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
|
||||
IRpcStubBufferVtbl *base_stub_buf_vtbl = &connect_test_base_stub_buffer_vtbl;
|
||||
HRESULT r;
|
||||
|
||||
obj = (IUnknown*)&new_vtbl;
|
||||
r = IRpcStubBuffer_Connect(pstub, obj);
|
||||
ok(r == S_OK, "r %08x\n", r);
|
||||
ok(connect_test_orig_release_called == 1, "release called %d\n", connect_test_orig_release_called);
|
||||
ok(cstd_stub->pvServerObject == (void*)0xcafebabe, "pvServerObject %p\n", cstd_stub->pvServerObject);
|
||||
|
||||
cstd_stub->pvServerObject = (IUnknown*)&orig_vtbl;
|
||||
obj = (IUnknown*)&new_fail_vtbl;
|
||||
r = IRpcStubBuffer_Connect(pstub, obj);
|
||||
ok(r == E_NOINTERFACE, "r %08x\n", r);
|
||||
ok(cstd_stub->pvServerObject == (void*)0xdeadbeef, "pvServerObject %p\n", cstd_stub->pvServerObject);
|
||||
ok(connect_test_orig_release_called == 2, "release called %d\n", connect_test_orig_release_called);
|
||||
|
||||
/* Now use a delegated stub.
|
||||
|
||||
We know from the NdrStubForwardFunction test that
|
||||
(void**)pstub-1 is the base interface stub buffer. This shows
|
||||
that (void**)pstub-2 contains the address of a vtable that gets
|
||||
passed to the base interface's Connect method. Note that
|
||||
(void**)pstub-2 itself gets passed to Connect and not
|
||||
*((void**)pstub-2), so it should contain the vtable ptr and not
|
||||
an interface ptr. */
|
||||
|
||||
obj = (IUnknown*)&orig_vtbl;
|
||||
pstub = create_stub(ppsf, &IID_if2, obj, S_OK);
|
||||
*((void**)pstub-1) = &base_stub_buf_vtbl;
|
||||
*((void**)pstub-2) = (void*)0xbeefcafe;
|
||||
|
||||
obj = (IUnknown*)&new_vtbl;
|
||||
r = IRpcStubBuffer_Connect(pstub, obj);
|
||||
ok(connect_test_base_Connect_called == 1, "connect_test_bsae_Connect called %d times\n",
|
||||
connect_test_base_Connect_called);
|
||||
ok(connect_test_orig_release_called == 3, "release called %d\n", connect_test_orig_release_called);
|
||||
cstd_stub = (CStdStubBuffer*)pstub;
|
||||
ok(cstd_stub->pvServerObject == (void*)0xcafebabe, "pvServerObject %p\n", cstd_stub->pvServerObject);
|
||||
}
|
||||
|
||||
static void test_Disconnect(IPSFactoryBuffer *ppsf)
|
||||
{
|
||||
IUnknownVtbl *orig_vtbl = &connect_test_orig_vtbl;
|
||||
IUnknown *obj = (IUnknown*)&orig_vtbl;
|
||||
IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
|
||||
CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
|
||||
|
||||
connect_test_orig_release_called = 0;
|
||||
IRpcStubBuffer_Disconnect(pstub);
|
||||
ok(connect_test_orig_release_called == 1, "release called %d\n", connect_test_orig_release_called);
|
||||
ok(cstd_stub->pvServerObject == NULL, "pvServerObject %p\n", cstd_stub->pvServerObject);
|
||||
}
|
||||
|
||||
|
||||
static int release_test_psfacbuf_release_called;
|
||||
static ULONG WINAPI release_test_pretend_psfacbuf_release(IUnknown *pUnk)
|
||||
{
|
||||
release_test_psfacbuf_release_called++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static IUnknownVtbl release_test_pretend_psfacbuf_vtbl =
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
release_test_pretend_psfacbuf_release
|
||||
};
|
||||
|
||||
static void test_Release(IPSFactoryBuffer *ppsf)
|
||||
{
|
||||
LONG facbuf_refs;
|
||||
IUnknownVtbl *orig_vtbl = &connect_test_orig_vtbl;
|
||||
IUnknown *obj = (IUnknown*)&orig_vtbl;
|
||||
IUnknownVtbl *pretend_psfacbuf_vtbl = &release_test_pretend_psfacbuf_vtbl;
|
||||
IUnknown *pretend_psfacbuf = (IUnknown *)&pretend_psfacbuf_vtbl;
|
||||
IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
|
||||
CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
|
||||
|
||||
facbuf_refs = PSFactoryBuffer.RefCount;
|
||||
|
||||
/* This shows that NdrCStdStubBuffer_Release doesn't call Disconnect */
|
||||
ok(cstd_stub->RefCount == 1, "ref count %d\n", cstd_stub->RefCount);
|
||||
connect_test_orig_release_called = 0;
|
||||
IRpcStubBuffer_Release(pstub);
|
||||
todo_wine {
|
||||
ok(connect_test_orig_release_called == 0, "release called %d\n", connect_test_orig_release_called);
|
||||
}
|
||||
ok(PSFactoryBuffer.RefCount == facbuf_refs - 1, "factory buffer refs %d orig %d\n", PSFactoryBuffer.RefCount, facbuf_refs);
|
||||
|
||||
/* This shows that NdrCStdStubBuffer_Release calls Release on its 2nd arg, rather than on This->pPSFactory
|
||||
(which are usually the same and indeed it's odd that _Release requires this 2nd arg). */
|
||||
pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
|
||||
ok(PSFactoryBuffer.RefCount == facbuf_refs, "factory buffer refs %d orig %d\n", PSFactoryBuffer.RefCount, facbuf_refs);
|
||||
NdrCStdStubBuffer_Release(pstub, (IPSFactoryBuffer*)pretend_psfacbuf);
|
||||
ok(release_test_psfacbuf_release_called == 1, "pretend_psfacbuf_release called %d\n", release_test_psfacbuf_release_called);
|
||||
ok(PSFactoryBuffer.RefCount == facbuf_refs, "factory buffer refs %d orig %d\n", PSFactoryBuffer.RefCount, facbuf_refs);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_test_QI(ITypeLib *pUnk, REFIID iid, void** ppv)
|
||||
{
|
||||
|
||||
*ppv = pUnk;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static ULONG WINAPI delegating_invoke_test_addref(ITypeLib *pUnk)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static ULONG WINAPI delegating_invoke_test_release(ITypeLib *pUnk)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static UINT WINAPI delegating_invoke_test_get_type_info_count(ITypeLib *pUnk)
|
||||
{
|
||||
return 0xabcdef;
|
||||
}
|
||||
|
||||
static ITypeLibVtbl delegating_invoke_test_obj_vtbl =
|
||||
{
|
||||
delegating_invoke_test_QI,
|
||||
delegating_invoke_test_addref,
|
||||
delegating_invoke_test_release,
|
||||
delegating_invoke_test_get_type_info_count,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_chan_query_interface(IRpcChannelBuffer *pchan,
|
||||
REFIID iid,
|
||||
void **ppv)
|
||||
{
|
||||
ok(0, "call to QueryInterface not expected\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI delegating_invoke_chan_add_ref(IRpcChannelBuffer *pchan)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static ULONG WINAPI delegating_invoke_chan_release(IRpcChannelBuffer *pchan)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_chan_get_buffer(IRpcChannelBuffer *pchan,
|
||||
RPCOLEMESSAGE *msg,
|
||||
REFIID iid)
|
||||
{
|
||||
msg->Buffer = HeapAlloc(GetProcessHeap(), 0, msg->cbBuffer);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_chan_send_receive(IRpcChannelBuffer *pchan,
|
||||
RPCOLEMESSAGE *pMessage,
|
||||
ULONG *pStatus)
|
||||
{
|
||||
ok(0, "call to SendReceive not expected\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_chan_free_buffer(IRpcChannelBuffer *pchan,
|
||||
RPCOLEMESSAGE *pMessage)
|
||||
{
|
||||
ok(0, "call to FreeBuffer not expected\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_chan_get_dest_ctx(IRpcChannelBuffer *pchan,
|
||||
DWORD *pdwDestContext,
|
||||
void **ppvDestContext)
|
||||
{
|
||||
*pdwDestContext = MSHCTX_LOCAL;
|
||||
*ppvDestContext = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI delegating_invoke_chan_is_connected(IRpcChannelBuffer *pchan)
|
||||
{
|
||||
ok(0, "call to IsConnected not expected\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static IRpcChannelBufferVtbl delegating_invoke_test_rpc_chan_vtbl =
|
||||
{
|
||||
delegating_invoke_chan_query_interface,
|
||||
delegating_invoke_chan_add_ref,
|
||||
delegating_invoke_chan_release,
|
||||
delegating_invoke_chan_get_buffer,
|
||||
delegating_invoke_chan_send_receive,
|
||||
delegating_invoke_chan_free_buffer,
|
||||
delegating_invoke_chan_get_dest_ctx,
|
||||
delegating_invoke_chan_is_connected
|
||||
};
|
||||
|
||||
static void test_delegating_Invoke(IPSFactoryBuffer *ppsf)
|
||||
{
|
||||
ITypeLibVtbl *obj_vtbl = &delegating_invoke_test_obj_vtbl;
|
||||
IUnknown *obj = (IUnknown*)&obj_vtbl;
|
||||
IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if2, obj, S_OK);
|
||||
IRpcChannelBufferVtbl *pchan_vtbl = &delegating_invoke_test_rpc_chan_vtbl;
|
||||
IRpcChannelBuffer *pchan = (IRpcChannelBuffer *)&pchan_vtbl;
|
||||
HRESULT r = E_FAIL;
|
||||
RPCOLEMESSAGE msg;
|
||||
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.dataRepresentation = NDR_LOCAL_DATA_REPRESENTATION;
|
||||
msg.iMethod = 3;
|
||||
r = IRpcStubBuffer_Invoke(pstub, &msg, pchan);
|
||||
ok(r == S_OK, "ret %08x\n", r);
|
||||
if(r == S_OK)
|
||||
{
|
||||
ok(*(DWORD*)msg.Buffer == 0xabcdef, "buf[0] %08x\n", *(DWORD*)msg.Buffer);
|
||||
ok(*((DWORD*)msg.Buffer + 1) == S_OK, "buf[1] %08x\n", *((DWORD*)msg.Buffer + 1));
|
||||
}
|
||||
IRpcStubBuffer_Release(pstub);
|
||||
}
|
||||
|
||||
START_TEST( cstub )
|
||||
{
|
||||
IPSFactoryBuffer *ppsf;
|
||||
|
||||
OleInitialize(NULL);
|
||||
|
||||
ppsf = test_NdrDllGetClassObject();
|
||||
test_NdrStubForwardingFunction();
|
||||
test_CreateStub(ppsf);
|
||||
test_Connect(ppsf);
|
||||
test_Disconnect(ppsf);
|
||||
test_Release(ppsf);
|
||||
test_delegating_Invoke(ppsf);
|
||||
|
||||
OleUninitialize();
|
||||
}
|
709
rostests/winetests/rpcrt4/generated.c
Normal file
709
rostests/winetests/rpcrt4/generated.c
Normal file
|
@ -0,0 +1,709 @@
|
|||
/* File generated automatically from tools/winapi/test.dat; do not edit! */
|
||||
/* This file can be copied, modified and distributed without restriction. */
|
||||
|
||||
/*
|
||||
* Unit tests for data structure packing
|
||||
*/
|
||||
|
||||
#define WINVER 0x0501
|
||||
#define _WIN32_IE 0x0501
|
||||
#define _WIN32_WINNT 0x0501
|
||||
|
||||
#define WINE_NOWINSOCK
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
#include "rpcproxy.h"
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
/***********************************************************************
|
||||
* Compability macros
|
||||
*/
|
||||
|
||||
#define DWORD_PTR UINT_PTR
|
||||
#define LONG_PTR INT_PTR
|
||||
#define ULONG_PTR UINT_PTR
|
||||
|
||||
/***********************************************************************
|
||||
* Windows API extension
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
|
||||
# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)
|
||||
#elif defined(__GNUC__)
|
||||
# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)
|
||||
#else
|
||||
/* FIXME: Not sure if is possible to do without compiler extension */
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
|
||||
# define _TYPE_ALIGNMENT(type) __alignof(type)
|
||||
#elif defined(__GNUC__)
|
||||
# define _TYPE_ALIGNMENT(type) __alignof__(type)
|
||||
#else
|
||||
/*
|
||||
* FIXME: Not sure if is possible to do without compiler extension
|
||||
* (if type is not just a name that is, if so the normal)
|
||||
* TYPE_ALIGNMENT can be used)
|
||||
*/
|
||||
#endif
|
||||
|
||||
#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
|
||||
#pragma warning(disable:4116)
|
||||
#endif
|
||||
|
||||
#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
|
||||
# define TYPE_ALIGNMENT _TYPE_ALIGNMENT
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* Test helper macros
|
||||
*/
|
||||
|
||||
#ifdef FIELD_ALIGNMENT
|
||||
# define TEST_FIELD_ALIGNMENT(type, field, align) \
|
||||
ok(FIELD_ALIGNMENT(type, field) == align, \
|
||||
"FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \
|
||||
(int)FIELD_ALIGNMENT(type, field))
|
||||
#else
|
||||
# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define TEST_FIELD_OFFSET(type, field, offset) \
|
||||
ok(FIELD_OFFSET(type, field) == offset, \
|
||||
"FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \
|
||||
(long int)FIELD_OFFSET(type, field))
|
||||
|
||||
#ifdef _TYPE_ALIGNMENT
|
||||
#define TEST__TYPE_ALIGNMENT(type, align) \
|
||||
ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)_TYPE_ALIGNMENT(type))
|
||||
#else
|
||||
# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef TYPE_ALIGNMENT
|
||||
#define TEST_TYPE_ALIGNMENT(type, align) \
|
||||
ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", (int)TYPE_ALIGNMENT(type))
|
||||
#else
|
||||
# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define TEST_TYPE_SIZE(type, size) \
|
||||
ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", ((int) sizeof(type)))
|
||||
|
||||
/***********************************************************************
|
||||
* Test macros
|
||||
*/
|
||||
|
||||
#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \
|
||||
TEST_TYPE_SIZE(field_type, field_size); \
|
||||
TEST_FIELD_ALIGNMENT(type, field_name, field_align); \
|
||||
TEST_FIELD_OFFSET(type, field_name, field_offset); \
|
||||
|
||||
#define TEST_TYPE(type, size, align) \
|
||||
TEST_TYPE_ALIGNMENT(type, align); \
|
||||
TEST_TYPE_SIZE(type, size)
|
||||
|
||||
#define TEST_TYPE_POINTER(type, size, align) \
|
||||
TEST__TYPE_ALIGNMENT(*(type)0, align); \
|
||||
TEST_TYPE_SIZE(*(type)0, size)
|
||||
|
||||
#define TEST_TYPE_SIGNED(type) \
|
||||
ok((type) -1 < 0, "(" #type ") -1 < 0\n");
|
||||
|
||||
#define TEST_TYPE_UNSIGNED(type) \
|
||||
ok((type) -1 > 0, "(" #type ") -1 > 0\n");
|
||||
|
||||
static void test_pack_I_RPC_HANDLE(void)
|
||||
{
|
||||
/* I_RPC_HANDLE */
|
||||
TEST_TYPE(I_RPC_HANDLE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_STATUS(void)
|
||||
{
|
||||
/* RPC_STATUS */
|
||||
TEST_TYPE(RPC_STATUS, 4, 4);
|
||||
TEST_TYPE_SIGNED(RPC_STATUS);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_POLICY(void)
|
||||
{
|
||||
/* PRPC_POLICY */
|
||||
TEST_TYPE(PRPC_POLICY, 4, 4);
|
||||
TEST_TYPE_POINTER(PRPC_POLICY, 12, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_AUTH_IDENTITY_HANDLE(void)
|
||||
{
|
||||
/* RPC_AUTH_IDENTITY_HANDLE */
|
||||
TEST_TYPE(RPC_AUTH_IDENTITY_HANDLE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_AUTH_KEY_RETRIEVAL_FN(void)
|
||||
{
|
||||
/* RPC_AUTH_KEY_RETRIEVAL_FN */
|
||||
}
|
||||
|
||||
static void test_pack_RPC_AUTHZ_HANDLE(void)
|
||||
{
|
||||
/* RPC_AUTHZ_HANDLE */
|
||||
TEST_TYPE(RPC_AUTHZ_HANDLE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_BINDING_HANDLE(void)
|
||||
{
|
||||
/* RPC_BINDING_HANDLE */
|
||||
TEST_TYPE(RPC_BINDING_HANDLE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_BINDING_VECTOR(void)
|
||||
{
|
||||
/* RPC_BINDING_VECTOR (pack 4) */
|
||||
TEST_TYPE(RPC_BINDING_VECTOR, 8, 4);
|
||||
TEST_FIELD(RPC_BINDING_VECTOR, unsigned long, Count, 0, 4, 4);
|
||||
TEST_FIELD(RPC_BINDING_VECTOR, RPC_BINDING_HANDLE[1], BindingH, 4, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_IF_HANDLE(void)
|
||||
{
|
||||
/* RPC_IF_HANDLE */
|
||||
TEST_TYPE(RPC_IF_HANDLE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_IF_ID(void)
|
||||
{
|
||||
/* RPC_IF_ID (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_RPC_POLICY(void)
|
||||
{
|
||||
/* RPC_POLICY (pack 4) */
|
||||
TEST_TYPE(RPC_POLICY, 12, 4);
|
||||
TEST_FIELD(RPC_POLICY, unsigned int, Length, 0, 4, 4);
|
||||
TEST_FIELD(RPC_POLICY, unsigned long, EndpointFlags, 4, 4, 4);
|
||||
TEST_FIELD(RPC_POLICY, unsigned long, NICFlags, 8, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_UUID_VECTOR(void)
|
||||
{
|
||||
/* UUID_VECTOR (pack 4) */
|
||||
TEST_TYPE(UUID_VECTOR, 8, 4);
|
||||
TEST_FIELD(UUID_VECTOR, unsigned long, Count, 0, 4, 4);
|
||||
TEST_FIELD(UUID_VECTOR, UUID *[1], Uuid, 4, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_CLIENT_INTERFACE(void)
|
||||
{
|
||||
/* PRPC_CLIENT_INTERFACE */
|
||||
TEST_TYPE(PRPC_CLIENT_INTERFACE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_DISPATCH_TABLE(void)
|
||||
{
|
||||
/* PRPC_DISPATCH_TABLE */
|
||||
TEST_TYPE(PRPC_DISPATCH_TABLE, 4, 4);
|
||||
TEST_TYPE_POINTER(PRPC_DISPATCH_TABLE, 12, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_MESSAGE(void)
|
||||
{
|
||||
/* PRPC_MESSAGE */
|
||||
TEST_TYPE(PRPC_MESSAGE, 4, 4);
|
||||
TEST_TYPE_POINTER(PRPC_MESSAGE, 44, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_PROTSEQ_ENDPOINT(void)
|
||||
{
|
||||
/* PRPC_PROTSEQ_ENDPOINT */
|
||||
TEST_TYPE(PRPC_PROTSEQ_ENDPOINT, 4, 4);
|
||||
TEST_TYPE_POINTER(PRPC_PROTSEQ_ENDPOINT, 8, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_SERVER_INTERFACE(void)
|
||||
{
|
||||
/* PRPC_SERVER_INTERFACE */
|
||||
TEST_TYPE(PRPC_SERVER_INTERFACE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_SYNTAX_IDENTIFIER(void)
|
||||
{
|
||||
/* PRPC_SYNTAX_IDENTIFIER */
|
||||
TEST_TYPE(PRPC_SYNTAX_IDENTIFIER, 4, 4);
|
||||
TEST_TYPE_POINTER(PRPC_SYNTAX_IDENTIFIER, 20, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_CLIENT_INTERFACE(void)
|
||||
{
|
||||
/* RPC_CLIENT_INTERFACE (pack 4) */
|
||||
TEST_FIELD(RPC_CLIENT_INTERFACE, unsigned int, Length, 0, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_DISPATCH_FUNCTION(void)
|
||||
{
|
||||
/* RPC_DISPATCH_FUNCTION */
|
||||
}
|
||||
|
||||
static void test_pack_RPC_DISPATCH_TABLE(void)
|
||||
{
|
||||
/* RPC_DISPATCH_TABLE (pack 4) */
|
||||
TEST_TYPE(RPC_DISPATCH_TABLE, 12, 4);
|
||||
TEST_FIELD(RPC_DISPATCH_TABLE, unsigned int, DispatchTableCount, 0, 4, 4);
|
||||
TEST_FIELD(RPC_DISPATCH_TABLE, RPC_DISPATCH_FUNCTION*, DispatchTable, 4, 4, 4);
|
||||
TEST_FIELD(RPC_DISPATCH_TABLE, LONG_PTR, Reserved, 8, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_MESSAGE(void)
|
||||
{
|
||||
/* RPC_MESSAGE (pack 4) */
|
||||
TEST_TYPE(RPC_MESSAGE, 44, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, RPC_BINDING_HANDLE, Handle, 0, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, unsigned long, DataRepresentation, 4, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, void*, Buffer, 8, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, unsigned int, BufferLength, 12, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, unsigned int, ProcNum, 16, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, PRPC_SYNTAX_IDENTIFIER, TransferSyntax, 20, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, void*, RpcInterfaceInformation, 24, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, void*, ReservedForRuntime, 28, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, RPC_MGR_EPV*, ManagerEpv, 32, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, void*, ImportContext, 36, 4, 4);
|
||||
TEST_FIELD(RPC_MESSAGE, unsigned long, RpcFlags, 40, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_PROTSEQ_ENDPOINT(void)
|
||||
{
|
||||
/* RPC_PROTSEQ_ENDPOINT (pack 4) */
|
||||
TEST_TYPE(RPC_PROTSEQ_ENDPOINT, 8, 4);
|
||||
TEST_FIELD(RPC_PROTSEQ_ENDPOINT, unsigned char*, RpcProtocolSequence, 0, 4, 4);
|
||||
TEST_FIELD(RPC_PROTSEQ_ENDPOINT, unsigned char*, Endpoint, 4, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_SERVER_INTERFACE(void)
|
||||
{
|
||||
/* RPC_SERVER_INTERFACE (pack 4) */
|
||||
TEST_FIELD(RPC_SERVER_INTERFACE, unsigned int, Length, 0, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_SYNTAX_IDENTIFIER(void)
|
||||
{
|
||||
/* RPC_SYNTAX_IDENTIFIER (pack 4) */
|
||||
TEST_TYPE(RPC_SYNTAX_IDENTIFIER, 20, 4);
|
||||
TEST_FIELD(RPC_SYNTAX_IDENTIFIER, GUID, SyntaxGUID, 0, 16, 4);
|
||||
TEST_FIELD(RPC_SYNTAX_IDENTIFIER, RPC_VERSION, SyntaxVersion, 16, 4, 2);
|
||||
}
|
||||
|
||||
static void test_pack_RPC_VERSION(void)
|
||||
{
|
||||
/* RPC_VERSION (pack 4) */
|
||||
TEST_TYPE(RPC_VERSION, 4, 2);
|
||||
TEST_FIELD(RPC_VERSION, unsigned short, MajorVersion, 0, 2, 2);
|
||||
TEST_FIELD(RPC_VERSION, unsigned short, MinorVersion, 2, 2, 2);
|
||||
}
|
||||
|
||||
static void test_pack_ARRAY_INFO(void)
|
||||
{
|
||||
/* ARRAY_INFO (pack 4) */
|
||||
TEST_TYPE(ARRAY_INFO, 24, 4);
|
||||
TEST_FIELD(ARRAY_INFO, long, Dimension, 0, 4, 4);
|
||||
TEST_FIELD(ARRAY_INFO, unsigned long *, BufferConformanceMark, 4, 4, 4);
|
||||
TEST_FIELD(ARRAY_INFO, unsigned long *, BufferVarianceMark, 8, 4, 4);
|
||||
TEST_FIELD(ARRAY_INFO, unsigned long *, MaxCountArray, 12, 4, 4);
|
||||
TEST_FIELD(ARRAY_INFO, unsigned long *, OffsetArray, 16, 4, 4);
|
||||
TEST_FIELD(ARRAY_INFO, unsigned long *, ActualCountArray, 20, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_COMM_FAULT_OFFSETS(void)
|
||||
{
|
||||
/* COMM_FAULT_OFFSETS (pack 4) */
|
||||
TEST_TYPE(COMM_FAULT_OFFSETS, 4, 2);
|
||||
TEST_FIELD(COMM_FAULT_OFFSETS, short, CommOffset, 0, 2, 2);
|
||||
TEST_FIELD(COMM_FAULT_OFFSETS, short, FaultOffset, 2, 2, 2);
|
||||
}
|
||||
|
||||
static void test_pack_CS_STUB_INFO(void)
|
||||
{
|
||||
/* CS_STUB_INFO (pack 4) */
|
||||
TEST_TYPE(CS_STUB_INFO, 12, 4);
|
||||
TEST_FIELD(CS_STUB_INFO, unsigned long, WireCodeset, 0, 4, 4);
|
||||
TEST_FIELD(CS_STUB_INFO, unsigned long, DesiredReceivingCodeset, 4, 4, 4);
|
||||
TEST_FIELD(CS_STUB_INFO, void *, CSArrayInfo, 8, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_EXPR_EVAL(void)
|
||||
{
|
||||
/* EXPR_EVAL */
|
||||
}
|
||||
|
||||
static void test_pack_FULL_PTR_TO_REFID_ELEMENT(void)
|
||||
{
|
||||
/* FULL_PTR_TO_REFID_ELEMENT (pack 4) */
|
||||
TEST_TYPE(FULL_PTR_TO_REFID_ELEMENT, 16, 4);
|
||||
TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, struct _FULL_PTR_TO_REFID_ELEMENT *, Next, 0, 4, 4);
|
||||
TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, void *, Pointer, 4, 4, 4);
|
||||
TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, unsigned long, RefId, 8, 4, 4);
|
||||
TEST_FIELD(FULL_PTR_TO_REFID_ELEMENT, unsigned char, State, 12, 1, 1);
|
||||
}
|
||||
|
||||
static void test_pack_FULL_PTR_XLAT_TABLES(void)
|
||||
{
|
||||
/* FULL_PTR_XLAT_TABLES (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_GENERIC_BINDING_INFO(void)
|
||||
{
|
||||
/* GENERIC_BINDING_INFO (pack 4) */
|
||||
TEST_FIELD(GENERIC_BINDING_INFO, void *, pObj, 0, 4, 4);
|
||||
TEST_FIELD(GENERIC_BINDING_INFO, unsigned int, Size, 4, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_GENERIC_BINDING_ROUTINE_PAIR(void)
|
||||
{
|
||||
/* GENERIC_BINDING_ROUTINE_PAIR (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_MALLOC_FREE_STRUCT(void)
|
||||
{
|
||||
/* MALLOC_FREE_STRUCT (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_MIDL_FORMAT_STRING(void)
|
||||
{
|
||||
/* MIDL_FORMAT_STRING (pack 4) */
|
||||
TEST_FIELD(MIDL_FORMAT_STRING, short, Pad, 0, 2, 2);
|
||||
}
|
||||
|
||||
static void test_pack_MIDL_SERVER_INFO(void)
|
||||
{
|
||||
/* MIDL_SERVER_INFO (pack 4) */
|
||||
TEST_TYPE(MIDL_SERVER_INFO, 32, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, PMIDL_STUB_DESC, pStubDesc, 0, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, SERVER_ROUTINE *, DispatchTable, 4, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, PFORMAT_STRING, ProcString, 8, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, unsigned short *, FmtStringOffset, 12, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, STUB_THUNK *, ThunkTable, 16, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, PRPC_SYNTAX_IDENTIFIER, pTransferSyntax, 20, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, ULONG_PTR, nCount, 24, 4, 4);
|
||||
TEST_FIELD(MIDL_SERVER_INFO, PMIDL_SYNTAX_INFO, pSyntaxInfo, 28, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_MIDL_STUB_DESC(void)
|
||||
{
|
||||
/* MIDL_STUB_DESC (pack 4) */
|
||||
TEST_FIELD(MIDL_STUB_DESC, void *, RpcInterfaceInformation, 0, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_MIDL_STUB_MESSAGE(void)
|
||||
{
|
||||
/* MIDL_STUB_MESSAGE (pack 4) */
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, PRPC_MESSAGE, RpcMsg, 0, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, Buffer, 4, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, BufferStart, 8, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, BufferEnd, 12, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, BufferMark, 16, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned long, BufferLength, 20, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned long, MemorySize, 24, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, Memory, 28, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, int, IsClient, 32, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, int, ReuseBuffer, 36, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, struct NDR_ALLOC_ALL_NODES_CONTEXT *, pAllocAllNodesContext, 40, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, struct NDR_POINTER_QUEUE_STATE *, pPointerQueueState, 44, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, int, IgnoreEmbeddedPointers, 48, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char *, PointerBufferMark, 52, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char, fBufferValid, 56, 1, 1);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned char, uFlags, 57, 1, 1);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, ULONG_PTR, MaxCount, 60, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned long, Offset, 64, 4, 4);
|
||||
TEST_FIELD(MIDL_STUB_MESSAGE, unsigned long, ActualCount, 68, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_MIDL_STUBLESS_PROXY_INFO(void)
|
||||
{
|
||||
/* MIDL_STUBLESS_PROXY_INFO (pack 4) */
|
||||
TEST_TYPE(MIDL_STUBLESS_PROXY_INFO, 24, 4);
|
||||
TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PMIDL_STUB_DESC, pStubDesc, 0, 4, 4);
|
||||
TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PFORMAT_STRING, ProcFormatString, 4, 4, 4);
|
||||
TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, unsigned short *, FormatStringOffset, 8, 4, 4);
|
||||
TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PRPC_SYNTAX_IDENTIFIER, pTransferSyntax, 12, 4, 4);
|
||||
TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, ULONG_PTR, nCount, 16, 4, 4);
|
||||
TEST_FIELD(MIDL_STUBLESS_PROXY_INFO, PMIDL_SYNTAX_INFO, pSyntaxInfo, 20, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_MIDL_SYNTAX_INFO(void)
|
||||
{
|
||||
/* MIDL_SYNTAX_INFO (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_NDR_CCONTEXT(void)
|
||||
{
|
||||
/* NDR_CCONTEXT */
|
||||
TEST_TYPE(NDR_CCONTEXT, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_NDR_NOTIFY_ROUTINE(void)
|
||||
{
|
||||
/* NDR_NOTIFY_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_NDR_NOTIFY2_ROUTINE(void)
|
||||
{
|
||||
/* NDR_NOTIFY2_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_NDR_RUNDOWN(void)
|
||||
{
|
||||
/* NDR_RUNDOWN */
|
||||
}
|
||||
|
||||
static void test_pack_NDR_SCONTEXT(void)
|
||||
{
|
||||
/* NDR_SCONTEXT */
|
||||
TEST_TYPE(NDR_SCONTEXT, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PARRAY_INFO(void)
|
||||
{
|
||||
/* PARRAY_INFO */
|
||||
TEST_TYPE(PARRAY_INFO, 4, 4);
|
||||
TEST_TYPE_POINTER(PARRAY_INFO, 24, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PFORMAT_STRING(void)
|
||||
{
|
||||
/* PFORMAT_STRING */
|
||||
TEST_TYPE(PFORMAT_STRING, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PFULL_PTR_TO_REFID_ELEMENT(void)
|
||||
{
|
||||
/* PFULL_PTR_TO_REFID_ELEMENT */
|
||||
TEST_TYPE(PFULL_PTR_TO_REFID_ELEMENT, 4, 4);
|
||||
TEST_TYPE_POINTER(PFULL_PTR_TO_REFID_ELEMENT, 16, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PFULL_PTR_XLAT_TABLES(void)
|
||||
{
|
||||
/* PFULL_PTR_XLAT_TABLES */
|
||||
TEST_TYPE(PFULL_PTR_XLAT_TABLES, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PGENERIC_BINDING_INFO(void)
|
||||
{
|
||||
/* PGENERIC_BINDING_INFO */
|
||||
TEST_TYPE(PGENERIC_BINDING_INFO, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PGENERIC_BINDING_ROUTINE_PAIR(void)
|
||||
{
|
||||
/* PGENERIC_BINDING_ROUTINE_PAIR */
|
||||
TEST_TYPE(PGENERIC_BINDING_ROUTINE_PAIR, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PMIDL_SERVER_INFO(void)
|
||||
{
|
||||
/* PMIDL_SERVER_INFO */
|
||||
TEST_TYPE(PMIDL_SERVER_INFO, 4, 4);
|
||||
TEST_TYPE_POINTER(PMIDL_SERVER_INFO, 32, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PMIDL_STUB_DESC(void)
|
||||
{
|
||||
/* PMIDL_STUB_DESC */
|
||||
TEST_TYPE(PMIDL_STUB_DESC, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PMIDL_STUB_MESSAGE(void)
|
||||
{
|
||||
/* PMIDL_STUB_MESSAGE */
|
||||
TEST_TYPE(PMIDL_STUB_MESSAGE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PMIDL_STUBLESS_PROXY_INFO(void)
|
||||
{
|
||||
/* PMIDL_STUBLESS_PROXY_INFO */
|
||||
TEST_TYPE(PMIDL_STUBLESS_PROXY_INFO, 4, 4);
|
||||
TEST_TYPE_POINTER(PMIDL_STUBLESS_PROXY_INFO, 24, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PMIDL_SYNTAX_INFO(void)
|
||||
{
|
||||
/* PMIDL_SYNTAX_INFO */
|
||||
TEST_TYPE(PMIDL_SYNTAX_INFO, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PNDR_ASYNC_MESSAGE(void)
|
||||
{
|
||||
/* PNDR_ASYNC_MESSAGE */
|
||||
TEST_TYPE(PNDR_ASYNC_MESSAGE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PNDR_CORRELATION_INFO(void)
|
||||
{
|
||||
/* PNDR_CORRELATION_INFO */
|
||||
TEST_TYPE(PNDR_CORRELATION_INFO, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PSCONTEXT_QUEUE(void)
|
||||
{
|
||||
/* PSCONTEXT_QUEUE */
|
||||
TEST_TYPE(PSCONTEXT_QUEUE, 4, 4);
|
||||
TEST_TYPE_POINTER(PSCONTEXT_QUEUE, 8, 4);
|
||||
}
|
||||
|
||||
static void test_pack_PXMIT_ROUTINE_QUINTUPLE(void)
|
||||
{
|
||||
/* PXMIT_ROUTINE_QUINTUPLE */
|
||||
TEST_TYPE(PXMIT_ROUTINE_QUINTUPLE, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_SCONTEXT_QUEUE(void)
|
||||
{
|
||||
/* SCONTEXT_QUEUE (pack 4) */
|
||||
TEST_TYPE(SCONTEXT_QUEUE, 8, 4);
|
||||
TEST_FIELD(SCONTEXT_QUEUE, unsigned long, NumberOfObjects, 0, 4, 4);
|
||||
TEST_FIELD(SCONTEXT_QUEUE, NDR_SCONTEXT *, ArrayOfObjects, 4, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_SERVER_ROUTINE(void)
|
||||
{
|
||||
/* SERVER_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_STUB_THUNK(void)
|
||||
{
|
||||
/* STUB_THUNK */
|
||||
}
|
||||
|
||||
static void test_pack_USER_MARSHAL_CB(void)
|
||||
{
|
||||
/* USER_MARSHAL_CB (pack 4) */
|
||||
TEST_FIELD(USER_MARSHAL_CB, unsigned long, Flags, 0, 4, 4);
|
||||
TEST_FIELD(USER_MARSHAL_CB, PMIDL_STUB_MESSAGE, pStubMsg, 4, 4, 4);
|
||||
TEST_FIELD(USER_MARSHAL_CB, PFORMAT_STRING, pReserve, 8, 4, 4);
|
||||
TEST_FIELD(USER_MARSHAL_CB, unsigned long, Signature, 12, 4, 4);
|
||||
}
|
||||
|
||||
static void test_pack_USER_MARSHAL_FREEING_ROUTINE(void)
|
||||
{
|
||||
/* USER_MARSHAL_FREEING_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_USER_MARSHAL_MARSHALLING_ROUTINE(void)
|
||||
{
|
||||
/* USER_MARSHAL_MARSHALLING_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_USER_MARSHAL_ROUTINE_QUADRUPLE(void)
|
||||
{
|
||||
/* USER_MARSHAL_ROUTINE_QUADRUPLE (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_USER_MARSHAL_SIZING_ROUTINE(void)
|
||||
{
|
||||
/* USER_MARSHAL_SIZING_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_USER_MARSHAL_UNMARSHALLING_ROUTINE(void)
|
||||
{
|
||||
/* USER_MARSHAL_UNMARSHALLING_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_XMIT_HELPER_ROUTINE(void)
|
||||
{
|
||||
/* XMIT_HELPER_ROUTINE */
|
||||
}
|
||||
|
||||
static void test_pack_XMIT_ROUTINE_QUINTUPLE(void)
|
||||
{
|
||||
/* XMIT_ROUTINE_QUINTUPLE (pack 4) */
|
||||
}
|
||||
|
||||
static void test_pack_PRPC_STUB_FUNCTION(void)
|
||||
{
|
||||
/* PRPC_STUB_FUNCTION */
|
||||
}
|
||||
|
||||
static void test_pack(void)
|
||||
{
|
||||
test_pack_ARRAY_INFO();
|
||||
test_pack_COMM_FAULT_OFFSETS();
|
||||
test_pack_CS_STUB_INFO();
|
||||
test_pack_EXPR_EVAL();
|
||||
test_pack_FULL_PTR_TO_REFID_ELEMENT();
|
||||
test_pack_FULL_PTR_XLAT_TABLES();
|
||||
test_pack_GENERIC_BINDING_INFO();
|
||||
test_pack_GENERIC_BINDING_ROUTINE_PAIR();
|
||||
test_pack_I_RPC_HANDLE();
|
||||
test_pack_MALLOC_FREE_STRUCT();
|
||||
test_pack_MIDL_FORMAT_STRING();
|
||||
test_pack_MIDL_SERVER_INFO();
|
||||
test_pack_MIDL_STUBLESS_PROXY_INFO();
|
||||
test_pack_MIDL_STUB_DESC();
|
||||
test_pack_MIDL_STUB_MESSAGE();
|
||||
test_pack_MIDL_SYNTAX_INFO();
|
||||
test_pack_NDR_CCONTEXT();
|
||||
test_pack_NDR_NOTIFY2_ROUTINE();
|
||||
test_pack_NDR_NOTIFY_ROUTINE();
|
||||
test_pack_NDR_RUNDOWN();
|
||||
test_pack_NDR_SCONTEXT();
|
||||
test_pack_PARRAY_INFO();
|
||||
test_pack_PFORMAT_STRING();
|
||||
test_pack_PFULL_PTR_TO_REFID_ELEMENT();
|
||||
test_pack_PFULL_PTR_XLAT_TABLES();
|
||||
test_pack_PGENERIC_BINDING_INFO();
|
||||
test_pack_PGENERIC_BINDING_ROUTINE_PAIR();
|
||||
test_pack_PMIDL_SERVER_INFO();
|
||||
test_pack_PMIDL_STUBLESS_PROXY_INFO();
|
||||
test_pack_PMIDL_STUB_DESC();
|
||||
test_pack_PMIDL_STUB_MESSAGE();
|
||||
test_pack_PMIDL_SYNTAX_INFO();
|
||||
test_pack_PNDR_ASYNC_MESSAGE();
|
||||
test_pack_PNDR_CORRELATION_INFO();
|
||||
test_pack_PRPC_CLIENT_INTERFACE();
|
||||
test_pack_PRPC_DISPATCH_TABLE();
|
||||
test_pack_PRPC_MESSAGE();
|
||||
test_pack_PRPC_POLICY();
|
||||
test_pack_PRPC_PROTSEQ_ENDPOINT();
|
||||
test_pack_PRPC_SERVER_INTERFACE();
|
||||
test_pack_PRPC_STUB_FUNCTION();
|
||||
test_pack_PRPC_SYNTAX_IDENTIFIER();
|
||||
test_pack_PSCONTEXT_QUEUE();
|
||||
test_pack_PXMIT_ROUTINE_QUINTUPLE();
|
||||
test_pack_RPC_AUTHZ_HANDLE();
|
||||
test_pack_RPC_AUTH_IDENTITY_HANDLE();
|
||||
test_pack_RPC_AUTH_KEY_RETRIEVAL_FN();
|
||||
test_pack_RPC_BINDING_HANDLE();
|
||||
test_pack_RPC_BINDING_VECTOR();
|
||||
test_pack_RPC_CLIENT_INTERFACE();
|
||||
test_pack_RPC_DISPATCH_FUNCTION();
|
||||
test_pack_RPC_DISPATCH_TABLE();
|
||||
test_pack_RPC_IF_HANDLE();
|
||||
test_pack_RPC_IF_ID();
|
||||
test_pack_RPC_MESSAGE();
|
||||
test_pack_RPC_POLICY();
|
||||
test_pack_RPC_PROTSEQ_ENDPOINT();
|
||||
test_pack_RPC_SERVER_INTERFACE();
|
||||
test_pack_RPC_STATUS();
|
||||
test_pack_RPC_SYNTAX_IDENTIFIER();
|
||||
test_pack_RPC_VERSION();
|
||||
test_pack_SCONTEXT_QUEUE();
|
||||
test_pack_SERVER_ROUTINE();
|
||||
test_pack_STUB_THUNK();
|
||||
test_pack_USER_MARSHAL_CB();
|
||||
test_pack_USER_MARSHAL_FREEING_ROUTINE();
|
||||
test_pack_USER_MARSHAL_MARSHALLING_ROUTINE();
|
||||
test_pack_USER_MARSHAL_ROUTINE_QUADRUPLE();
|
||||
test_pack_USER_MARSHAL_SIZING_ROUTINE();
|
||||
test_pack_USER_MARSHAL_UNMARSHALLING_ROUTINE();
|
||||
test_pack_UUID_VECTOR();
|
||||
test_pack_XMIT_HELPER_ROUTINE();
|
||||
test_pack_XMIT_ROUTINE_QUINTUPLE();
|
||||
}
|
||||
|
||||
START_TEST(generated)
|
||||
{
|
||||
test_pack();
|
||||
}
|
1524
rostests/winetests/rpcrt4/ndr_marshall.c
Normal file
1524
rostests/winetests/rpcrt4/ndr_marshall.c
Normal file
File diff suppressed because it is too large
Load diff
385
rostests/winetests/rpcrt4/rpc.c
Normal file
385
rostests/winetests/rpcrt4/rpc.c
Normal file
|
@ -0,0 +1,385 @@
|
|||
/*
|
||||
* Unit test suite for rpc functions
|
||||
*
|
||||
* Copyright 2002 Greg Turner
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winnt.h>
|
||||
#include <winerror.h>
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcdce.h"
|
||||
|
||||
typedef unsigned int unsigned32;
|
||||
typedef struct twr_t
|
||||
{
|
||||
unsigned32 tower_length;
|
||||
/* [size_is] */ byte tower_octet_string[ 1 ];
|
||||
} twr_t;
|
||||
|
||||
RPC_STATUS WINAPI TowerExplode(const twr_t *tower, RPC_SYNTAX_IDENTIFIER *object, RPC_SYNTAX_IDENTIFIER *syntax, char **protseq, char **endpoint, char **address);
|
||||
RPC_STATUS WINAPI TowerConstruct(const RPC_SYNTAX_IDENTIFIER *object, const RPC_SYNTAX_IDENTIFIER *syntax, const char *protseq, const char *endpoint, const char *address, twr_t **tower);
|
||||
|
||||
static UUID Uuid_Table[10] = {
|
||||
{ 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, /* 0 (null) */
|
||||
{ 0xdeadbeef, 0xdead, 0xbeef, {0x10, 0x21, 0x35, 0x56, 0x89, 0xa0, 0xf4, 0x8a} }, /* 1 */
|
||||
{ 0xabadfeed, 0x49ff, 0xbead, {0x8a, 0xf4, 0xa0, 0x89, 0x56, 0x35, 0x21, 0x10} }, /* 2 */
|
||||
{ 0x93da375c, 0x1324, 0x1355, {0x87, 0xff, 0x49, 0x44, 0x34, 0x44, 0x22, 0x19} }, /* 3 */
|
||||
{ 0xdeadbeef, 0xdead, 0xbeef, {0x10, 0x21, 0x35, 0x56, 0x89, 0xa0, 0xf4, 0x8b} }, /* 4 (~1) */
|
||||
{ 0x9badfeed, 0x49ff, 0xbead, {0x8a, 0xf4, 0xa0, 0x89, 0x56, 0x35, 0x21, 0x10} }, /* 5 (~2) */
|
||||
{ 0x00000000, 0x0001, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, /* 6 (~0) */
|
||||
{ 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} }, /* 7 (~0) */
|
||||
{ 0x12312312, 0x1231, 0x1231, {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xff} }, /* 8 */
|
||||
{ 0x11111111, 0x1111, 0x1111, {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11} } /* 9 */
|
||||
};
|
||||
|
||||
/* index of "10" means "NULL" */
|
||||
static BOOL Uuid_Comparison_Grid[11][11] = {
|
||||
{ TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE },
|
||||
{ FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE },
|
||||
{ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE },
|
||||
{ TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }
|
||||
};
|
||||
|
||||
static void UuidConversionAndComparison(void) {
|
||||
CHAR strx[100], x;
|
||||
LPSTR str = strx;
|
||||
WCHAR wstrx[100], wx;
|
||||
LPWSTR wstr = wstrx;
|
||||
|
||||
UUID Uuid1, Uuid2, *PUuid1, *PUuid2;
|
||||
RPC_STATUS rslt;
|
||||
|
||||
int i1,i2;
|
||||
|
||||
/* Uuid Equality */
|
||||
for (i1 = 0; i1 < 11; i1++)
|
||||
for (i2 = 0; i2 < 11; i2++) {
|
||||
if (i1 < 10) {
|
||||
Uuid1 = Uuid_Table[i1];
|
||||
PUuid1 = &Uuid1;
|
||||
} else {
|
||||
PUuid1 = NULL;
|
||||
}
|
||||
if (i2 < 10) {
|
||||
Uuid2 = Uuid_Table[i2];
|
||||
PUuid2 = &Uuid2;
|
||||
} else {
|
||||
PUuid2 = NULL;
|
||||
}
|
||||
ok( (UuidEqual(PUuid1, PUuid2, &rslt) == Uuid_Comparison_Grid[i1][i2]), "UUID Equality\n" );
|
||||
}
|
||||
|
||||
/* Uuid to String to Uuid (char) */
|
||||
for (i1 = 0; i1 < 10; i1++) {
|
||||
Uuid1 = Uuid_Table[i1];
|
||||
ok( (UuidToStringA(&Uuid1, (unsigned char**)&str) == RPC_S_OK), "Simple UUID->String copy\n" );
|
||||
ok( (UuidFromStringA((unsigned char*)str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String\n" );
|
||||
ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform\n" );
|
||||
/* invalid uuid tests -- size of valid UUID string=36 */
|
||||
for (i2 = 0; i2 < 36; i2++) {
|
||||
x = str[i2];
|
||||
str[i2] = 'g'; /* whatever, but "g" is a good boundary condition */
|
||||
ok( (UuidFromStringA((unsigned char*)str, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID String\n" );
|
||||
str[i2] = x; /* change it back so remaining tests are interesting. */
|
||||
}
|
||||
}
|
||||
|
||||
/* Uuid to String to Uuid (wchar) */
|
||||
for (i1 = 0; i1 < 10; i1++) {
|
||||
Uuid1 = Uuid_Table[i1];
|
||||
rslt=UuidToStringW(&Uuid1, &wstr);
|
||||
if (rslt==RPC_S_CANNOT_SUPPORT) {
|
||||
/* Must be Win9x (no Unicode support), skip the tests */
|
||||
break;
|
||||
}
|
||||
ok( (rslt == RPC_S_OK), "Simple UUID->WString copy\n" );
|
||||
ok( (UuidFromStringW(wstr, &Uuid2) == RPC_S_OK), "Simple WString->UUID copy from generated UUID String\n" );
|
||||
ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> WString -> Uuid transform\n" );
|
||||
/* invalid uuid tests -- size of valid UUID string=36 */
|
||||
for (i2 = 0; i2 < 36; i2++) {
|
||||
wx = wstr[i2];
|
||||
wstr[i2] = 'g'; /* whatever, but "g" is a good boundary condition */
|
||||
ok( (UuidFromStringW(wstr, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID WString\n" );
|
||||
wstr[i2] = wx; /* change it back so remaining tests are interesting. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TestDceErrorInqText (void)
|
||||
{
|
||||
char bufferInvalid [1024];
|
||||
char buffer [1024]; /* The required size is not documented but would
|
||||
* appear to be 256.
|
||||
*/
|
||||
DWORD dwCount;
|
||||
|
||||
dwCount = FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL, RPC_S_NOT_RPC_ERROR, 0, bufferInvalid,
|
||||
sizeof(bufferInvalid)/sizeof(bufferInvalid[0]), NULL);
|
||||
|
||||
/* A random sample of DceErrorInqText */
|
||||
/* 0 is success */
|
||||
ok ((DceErrorInqTextA (0, (unsigned char*)buffer) == RPC_S_OK),
|
||||
"DceErrorInqTextA(0...)\n");
|
||||
/* A real RPC_S error */
|
||||
ok ((DceErrorInqTextA (RPC_S_INVALID_STRING_UUID, (unsigned char*)buffer) == RPC_S_OK),
|
||||
"DceErrorInqTextA(valid...)\n");
|
||||
|
||||
if (dwCount)
|
||||
{
|
||||
/* A message for which FormatMessage should fail
|
||||
* which should return RPC_S_OK and the
|
||||
* fixed "not valid" message
|
||||
*/
|
||||
ok ((DceErrorInqTextA (35, (unsigned char*)buffer) == RPC_S_OK &&
|
||||
strcmp (buffer, bufferInvalid) == 0),
|
||||
"DceErrorInqTextA(unformattable...)\n");
|
||||
/* One for which FormatMessage should succeed but
|
||||
* DceErrorInqText should "fail"
|
||||
* 3814 is generally quite a long message
|
||||
*/
|
||||
ok ((DceErrorInqTextA (3814, (unsigned char*)buffer) == RPC_S_OK &&
|
||||
strcmp (buffer, bufferInvalid) == 0),
|
||||
"DceErrorInqTextA(deviation...)\n");
|
||||
}
|
||||
else
|
||||
ok (0, "Cannot set up for DceErrorInqText\n");
|
||||
}
|
||||
|
||||
static RPC_DISPATCH_FUNCTION IFoo_table[] =
|
||||
{
|
||||
0
|
||||
};
|
||||
|
||||
static RPC_DISPATCH_TABLE IFoo_v0_0_DispatchTable =
|
||||
{
|
||||
0,
|
||||
IFoo_table
|
||||
};
|
||||
|
||||
static const RPC_SERVER_INTERFACE IFoo___RpcServerInterface =
|
||||
{
|
||||
sizeof(RPC_SERVER_INTERFACE),
|
||||
{{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x34}},{0,0}},
|
||||
{{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
|
||||
&IFoo_v0_0_DispatchTable,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
static RPC_IF_HANDLE IFoo_v0_0_s_ifspec = (RPC_IF_HANDLE)& IFoo___RpcServerInterface;
|
||||
|
||||
static void test_rpc_ncacn_ip_tcp(void)
|
||||
{
|
||||
RPC_STATUS status;
|
||||
unsigned char *binding;
|
||||
handle_t IFoo_IfHandle;
|
||||
static unsigned char foo[] = "foo";
|
||||
static unsigned char ncacn_ip_tcp[] = "ncacn_ip_tcp";
|
||||
static unsigned char address[] = "127.0.0.1";
|
||||
static unsigned char endpoint[] = "4114";
|
||||
|
||||
status = RpcNetworkIsProtseqValid(foo);
|
||||
ok(status == RPC_S_INVALID_RPC_PROTSEQ, "return wrong\n");
|
||||
|
||||
status = RpcNetworkIsProtseqValid(ncacn_ip_tcp);
|
||||
ok(status == RPC_S_OK, "return wrong\n");
|
||||
|
||||
status = RpcMgmtStopServerListening(NULL);
|
||||
todo_wine {
|
||||
ok(status == RPC_S_NOT_LISTENING,
|
||||
"wrong RpcMgmtStopServerListening error (%lu)\n", status);
|
||||
}
|
||||
|
||||
status = RpcMgmtWaitServerListen();
|
||||
ok(status == RPC_S_NOT_LISTENING,
|
||||
"wrong RpcMgmtWaitServerListen error status (%lu)\n", status);
|
||||
|
||||
status = RpcServerListen(1, 20, FALSE);
|
||||
ok(status == RPC_S_NO_PROTSEQS_REGISTERED,
|
||||
"wrong RpcServerListen error (%lu)\n", status);
|
||||
|
||||
status = RpcServerUseProtseqEp(ncacn_ip_tcp, 20, endpoint, NULL);
|
||||
ok(status == RPC_S_OK, "RpcServerUseProtseqEp failed (%lu)\n", status);
|
||||
|
||||
status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL);
|
||||
ok(status == RPC_S_OK, "RpcServerRegisterIf failed (%lu)\n", status);
|
||||
|
||||
status = RpcServerListen(1, 20, TRUE);
|
||||
todo_wine {
|
||||
ok(status == RPC_S_OK, "RpcServerListen failed (%lu)\n", status);
|
||||
}
|
||||
|
||||
status = RpcServerListen(1, 20, TRUE);
|
||||
todo_wine {
|
||||
ok(status == RPC_S_ALREADY_LISTENING,
|
||||
"wrong RpcServerListen error (%lu)\n", status);
|
||||
}
|
||||
|
||||
status = RpcStringBindingCompose(NULL, ncacn_ip_tcp, address,
|
||||
endpoint, NULL, &binding);
|
||||
ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%lu)\n", status);
|
||||
|
||||
status = RpcBindingFromStringBinding(binding, &IFoo_IfHandle);
|
||||
ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%lu)\n",
|
||||
status);
|
||||
|
||||
status = RpcMgmtStopServerListening(NULL);
|
||||
ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%lu)\n",
|
||||
status);
|
||||
|
||||
status = RpcMgmtStopServerListening(NULL);
|
||||
ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%lu)\n",
|
||||
status);
|
||||
|
||||
status = RpcServerUnregisterIf(NULL, NULL, FALSE);
|
||||
ok(status == RPC_S_OK, "RpcServerUnregisterIf failed (%lu)\n", status);
|
||||
|
||||
status = RpcMgmtWaitServerListen();
|
||||
todo_wine {
|
||||
ok(status == RPC_S_OK, "RpcMgmtWaitServerListen failed (%lu)\n", status);
|
||||
}
|
||||
|
||||
status = RpcStringFree(&binding);
|
||||
ok(status == RPC_S_OK, "RpcStringFree failed (%lu)\n", status);
|
||||
|
||||
status = RpcBindingFree(&IFoo_IfHandle);
|
||||
ok(status == RPC_S_OK, "RpcBindingFree failed (%lu)\n", status);
|
||||
}
|
||||
|
||||
/* this is what's generated with MS/RPC - it includes an extra 2
|
||||
* bytes in the protocol floor */
|
||||
static const unsigned char tower_data_tcp_ip1[] =
|
||||
{
|
||||
0x05,0x00,0x13,0x00,0x0d,0x00,0xdb,0xf1,
|
||||
0xa4,0x47,0xca,0x67,0x10,0xb3,0x1f,0x00,
|
||||
0xdd,0x01,0x06,0x62,0xda,0x00,0x00,0x02,
|
||||
0x00,0x00,0x00,0x13,0x00,0x0d,0x04,0x5d,
|
||||
0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,
|
||||
0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,
|
||||
0x02,0x00,0x00,0x00,0x01,0x00,0x0b,0x02,
|
||||
0x00,0x00,0x00,0x01,0x00,0x07,0x02,0x00,
|
||||
0x00,0x87,0x01,0x00,0x09,0x04,0x00,0x0a,
|
||||
0x00,0x00,0x01,
|
||||
};
|
||||
/* this is the optimal data that i think should be generated */
|
||||
static const unsigned char tower_data_tcp_ip2[] =
|
||||
{
|
||||
0x05,0x00,0x13,0x00,0x0d,0x00,0xdb,0xf1,
|
||||
0xa4,0x47,0xca,0x67,0x10,0xb3,0x1f,0x00,
|
||||
0xdd,0x01,0x06,0x62,0xda,0x00,0x00,0x02,
|
||||
0x00,0x00,0x00,0x13,0x00,0x0d,0x04,0x5d,
|
||||
0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,
|
||||
0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,
|
||||
0x02,0x00,0x00,0x00,0x01,0x00,0x0b,0x00,
|
||||
0x00,0x01,0x00,0x07,0x02,0x00,0x00,0x87,
|
||||
0x01,0x00,0x09,0x04,0x00,0x0a,0x00,0x00,
|
||||
0x01,
|
||||
};
|
||||
|
||||
static void test_towers(void)
|
||||
{
|
||||
RPC_STATUS ret;
|
||||
twr_t *tower;
|
||||
static const RPC_SYNTAX_IDENTIFIER mapi_if_id = { { 0xa4f1db00, 0xca47, 0x1067, { 0xb3, 0x1f, 0x00, 0xdd, 0x01, 0x06, 0x62, 0xda } }, { 0, 0 } };
|
||||
static const RPC_SYNTAX_IDENTIFIER ndr_syntax = { { 0x8a885d04, 0x1ceb, 0x11c9, { 0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60 } }, { 2, 0 } };
|
||||
RPC_SYNTAX_IDENTIFIER object, syntax;
|
||||
char *protseq, *endpoint, *address;
|
||||
BOOL same;
|
||||
|
||||
ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "10.0.0.1", &tower);
|
||||
ok(ret == RPC_S_OK, "TowerConstruct failed with error %ld\n", ret);
|
||||
|
||||
/* first check we have the right amount of data */
|
||||
ok(tower->tower_length == sizeof(tower_data_tcp_ip1) ||
|
||||
tower->tower_length == sizeof(tower_data_tcp_ip2),
|
||||
"Wrong size of tower %d\n", tower->tower_length);
|
||||
|
||||
/* then do a byte-by-byte comparison */
|
||||
same = ((tower->tower_length == sizeof(tower_data_tcp_ip1)) &&
|
||||
!memcmp(&tower->tower_octet_string, tower_data_tcp_ip1, sizeof(tower_data_tcp_ip1))) ||
|
||||
((tower->tower_length == sizeof(tower_data_tcp_ip2)) &&
|
||||
!memcmp(&tower->tower_octet_string, tower_data_tcp_ip2, sizeof(tower_data_tcp_ip2)));
|
||||
|
||||
ok(same, "Tower data differs\n");
|
||||
if (!same)
|
||||
{
|
||||
unsigned32 i;
|
||||
for (i = 0; i < tower->tower_length; i++)
|
||||
{
|
||||
if (i % 8 == 0) printf(" ");
|
||||
printf("0x%02x,", tower->tower_octet_string[i]);
|
||||
if (i % 8 == 7) printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
ret = TowerExplode(tower, &object, &syntax, &protseq, &endpoint, &address);
|
||||
ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
|
||||
ok(!memcmp(&object, &mapi_if_id, sizeof(mapi_if_id)), "object id didn't match\n");
|
||||
ok(!memcmp(&syntax, &ndr_syntax, sizeof(syntax)), "syntax id didn't match\n");
|
||||
ok(!strcmp(protseq, "ncacn_ip_tcp"), "protseq was \"%s\" instead of \"ncacn_ip_tcp\"\n", protseq);
|
||||
ok(!strcmp(endpoint, "135"), "endpoint was \"%s\" instead of \"135\"\n", endpoint);
|
||||
ok(!strcmp(address, "10.0.0.1"), "address was \"%s\" instead of \"10.0.0.1\"\n", address);
|
||||
|
||||
I_RpcFree(protseq);
|
||||
I_RpcFree(endpoint);
|
||||
I_RpcFree(address);
|
||||
|
||||
ret = TowerExplode(tower, NULL, NULL, NULL, NULL, NULL);
|
||||
ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
|
||||
|
||||
I_RpcFree(tower);
|
||||
|
||||
/* test the behaviour for ip_tcp with name instead of dotted IP notation */
|
||||
ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "localhost", &tower);
|
||||
ok(ret == RPC_S_OK, "TowerConstruct failed with error %ld\n", ret);
|
||||
ret = TowerExplode(tower, NULL, NULL, NULL, NULL, &address);
|
||||
ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
|
||||
ok(!strcmp(address, "0.0.0.0"), "address was \"%s\" instead of \"0.0.0.0\"\n", address);
|
||||
|
||||
I_RpcFree(address);
|
||||
I_RpcFree(tower);
|
||||
}
|
||||
|
||||
START_TEST( rpc )
|
||||
{
|
||||
trace ( " ** Uuid Conversion and Comparison Tests **\n" );
|
||||
UuidConversionAndComparison();
|
||||
trace ( " ** DceErrorInqText **\n");
|
||||
TestDceErrorInqText();
|
||||
test_rpc_ncacn_ip_tcp();
|
||||
test_towers();
|
||||
}
|
25
rostests/winetests/rpcrt4/rpcrt4.rbuild
Normal file
25
rostests/winetests/rpcrt4/rpcrt4.rbuild
Normal file
|
@ -0,0 +1,25 @@
|
|||
<module name="rpcrt4_winetest_server" type="rpcserver" allowwarnings="true">
|
||||
<file>server.idl</file>
|
||||
</module>
|
||||
<module name="rpcrt4_winetest_client" type="rpcclient">
|
||||
<file>server.idl</file>
|
||||
</module>
|
||||
<module name="rpcrt4_winetest" type="win32cui" installbase="bin" installname="rpcrt4_winetest.exe" allowwarnings="true">
|
||||
<include base="rpcrt4_winetest">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<library>wine</library>
|
||||
<library>pseh</library>
|
||||
<library>ole32</library>
|
||||
<library>uuid</library>
|
||||
<library>rpcrt4_winetest_server</library>
|
||||
<library>rpcrt4_winetest_client</library>
|
||||
<library>rpcrt4</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
<file>cstub.c</file>
|
||||
<file>generated.c</file>
|
||||
<file>ndr_marshall.c</file>
|
||||
<file>rpc.c</file>
|
||||
<file>server.c</file>
|
||||
<file>testlist.c</file>
|
||||
</module>
|
1244
rostests/winetests/rpcrt4/server.c
Normal file
1244
rostests/winetests/rpcrt4/server.c
Normal file
File diff suppressed because it is too large
Load diff
308
rostests/winetests/rpcrt4/server.idl
Normal file
308
rostests/winetests/rpcrt4/server.idl
Normal file
|
@ -0,0 +1,308 @@
|
|||
/*
|
||||
* A simple interface to test the RPC server.
|
||||
*
|
||||
* Copyright (C) Google 2007 (Dan Hipschman)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "server_defines.h"
|
||||
|
||||
typedef struct tag_vector
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
} vector_t;
|
||||
|
||||
[
|
||||
uuid(00000000-4114-0704-2301-000000000000),
|
||||
#ifndef __midl
|
||||
implicit_handle(handle_t IServer_IfHandle)
|
||||
#endif
|
||||
]
|
||||
interface IServer
|
||||
{
|
||||
cpp_quote("#if 0")
|
||||
typedef wchar_t WCHAR;
|
||||
cpp_quote("#endif")
|
||||
|
||||
typedef [string] char *str_t;
|
||||
typedef [string] WCHAR *wstr_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int *pi;
|
||||
int **ppi;
|
||||
int ***pppi;
|
||||
} pints_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *pc;
|
||||
short *ps;
|
||||
long *pl;
|
||||
float *pf;
|
||||
double *pd;
|
||||
} ptypes_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vector_t *pu;
|
||||
vector_t **pv;
|
||||
} pvectors_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
[switch_is(s)] union
|
||||
{
|
||||
[case(SUN_I)] int i;
|
||||
[case(SUN_F1, SUN_F2)] float f;
|
||||
[case(SUN_PI)] int *pi;
|
||||
} u;
|
||||
|
||||
int s;
|
||||
} sun_t;
|
||||
|
||||
int int_return(void);
|
||||
int square(int x);
|
||||
int sum(int x, int y);
|
||||
void square_out(int x, [out] int *y);
|
||||
void square_ref([in, out] int *x);
|
||||
int str_length([string] const char *s);
|
||||
int cstr_length([string, size_is(n)] const char *s, int n);
|
||||
int dot_self(vector_t *v);
|
||||
double square_half(double x, [out] double *y);
|
||||
float square_half_float(float x, [out] float *y);
|
||||
long square_half_long(long x, [out] long *y);
|
||||
int sum_fixed_array(int a[5]);
|
||||
int pints_sum(pints_t *pints);
|
||||
double ptypes_sum(ptypes_t *ptypes);
|
||||
int dot_pvectors(pvectors_t *pvectors);
|
||||
|
||||
/* don't use this anywhere except in sp_t */
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
} sp_inner_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
sp_inner_t *s;
|
||||
} sp_t;
|
||||
|
||||
int sum_sp(sp_t *sp);
|
||||
double square_sun(sun_t *su);
|
||||
|
||||
typedef struct test_list
|
||||
{
|
||||
int t;
|
||||
[switch_is(t)] union
|
||||
{
|
||||
[case(TL_NULL)] char x; /* end of list */
|
||||
[case(TL_LIST)] struct test_list *tail;
|
||||
} u;
|
||||
} test_list_t;
|
||||
|
||||
int test_list_length(test_list_t *ls);
|
||||
int sum_fixed_int_3d(int m[2][3][4]);
|
||||
int sum_conf_array([size_is(n)] int x[], int n);
|
||||
int sum_unique_conf_array([size_is(n), unique] int x[], int n);
|
||||
int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
|
||||
int sum_var_array([length_is(n)] int x[20], int n);
|
||||
int dot_two_vectors(vector_t vs[2]);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int n;
|
||||
[size_is(n)] int ca[];
|
||||
} cs_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int *pn;
|
||||
[size_is(*pn)] int *ca1;
|
||||
[size_is(n * 2)] int *ca2;
|
||||
int n;
|
||||
} cps_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
[size_is(c ? a : b)] int *ca;
|
||||
int a;
|
||||
int b;
|
||||
int c;
|
||||
} cpsc_t;
|
||||
|
||||
int sum_cs(cs_t *cs);
|
||||
int sum_cps(cps_t *cps);
|
||||
int sum_cpsc(cpsc_t *cpsc);
|
||||
|
||||
typedef [wire_marshal(int)] void *puint_t;
|
||||
int square_puint(puint_t p);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
[size_is(n)] puint_t *ps;
|
||||
int n;
|
||||
} puints_t;
|
||||
|
||||
/* Same thing as puints_t, but make it complex (needs padding). */
|
||||
typedef struct
|
||||
{
|
||||
[size_is(n)] puint_t *ps;
|
||||
char n;
|
||||
} cpuints_t;
|
||||
|
||||
int sum_puints(puints_t *p);
|
||||
int sum_cpuints(cpuints_t *p);
|
||||
int dot_copy_vectors(vector_t u, vector_t v);
|
||||
|
||||
typedef struct wire_us *wire_us_t;
|
||||
typedef [wire_marshal(wire_us_t)] struct us us_t;
|
||||
struct us
|
||||
{
|
||||
void *x;
|
||||
};
|
||||
struct wire_us
|
||||
{
|
||||
int x;
|
||||
};
|
||||
typedef struct
|
||||
{
|
||||
us_t us;
|
||||
} test_us_t;
|
||||
|
||||
int square_test_us(test_us_t *tus);
|
||||
|
||||
typedef union encu switch (int t)
|
||||
{
|
||||
case ENCU_I: int i;
|
||||
case ENCU_F: float f;
|
||||
} encu_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E1 = 23,
|
||||
E2 = 4,
|
||||
E3 = 0,
|
||||
E4 = 64
|
||||
} e_t;
|
||||
|
||||
typedef union encue switch (e_t t)
|
||||
{
|
||||
case E1: int i1;
|
||||
case E2: float f2;
|
||||
} encue_t;
|
||||
|
||||
double square_encu(encu_t *eu);
|
||||
int sum_parr(int *a[3]);
|
||||
int sum_pcarr([size_is(n)] int *a[], int n);
|
||||
int enum_ord(e_t e);
|
||||
double square_encue(encue_t *eue);
|
||||
|
||||
int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
|
||||
int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char c;
|
||||
int i;
|
||||
short s;
|
||||
double d;
|
||||
} aligns_t;
|
||||
|
||||
double sum_aligns(aligns_t *a);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int i;
|
||||
char c;
|
||||
} padded_t;
|
||||
|
||||
int sum_padded(padded_t *p);
|
||||
int sum_padded2(padded_t ps[2]);
|
||||
int sum_padded_conf([size_is(n)] padded_t *ps, int n);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int *p1;
|
||||
} bogus_helper_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bogus_helper_t h;
|
||||
int *p2;
|
||||
int *p3;
|
||||
char c;
|
||||
} bogus_t;
|
||||
|
||||
int sum_bogus(bogus_t *b);
|
||||
void check_null([unique] int *null);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
str_t s;
|
||||
} str_struct_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wstr_t s;
|
||||
} wstr_struct_t;
|
||||
|
||||
int str_struct_len(str_struct_t *s);
|
||||
int wstr_struct_len(wstr_struct_t *s);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int n;
|
||||
[size_is(n)] byte a[];
|
||||
} doub_carr_1_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int n;
|
||||
[size_is(n)] doub_carr_1_t *a[];
|
||||
} doub_carr_t;
|
||||
|
||||
int sum_doub_carr(doub_carr_t *dc);
|
||||
void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short n;
|
||||
[size_is(n)] short data[];
|
||||
} wire_bstr_t;
|
||||
|
||||
typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
|
||||
unsigned hash_bstr(bstr_t s);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
[string, size_is(size)] char *name;
|
||||
unsigned int size;
|
||||
} name_t;
|
||||
void get_name([in,out] name_t *name);
|
||||
|
||||
int sum_pcarr2(int n, [size_is(, n)] int **pa);
|
||||
int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
|
||||
|
||||
void get_5numbers([in] int count, [out, length_is(count)] pints_t pn[5]);
|
||||
void get_numbers([in] int length, [in] int size, [out, length_is(length), size_is(size)] pints_t pn[]);
|
||||
str_t get_filename(void);
|
||||
void context_handle_test(void);
|
||||
void stop(void);
|
||||
}
|
33
rostests/winetests/rpcrt4/server_defines.h
Normal file
33
rostests/winetests/rpcrt4/server_defines.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Constants shared between server.c and server.idl
|
||||
*
|
||||
* Copyright (C) Google 2007 (Dan Hipschman)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* sun_t case values */
|
||||
#define SUN_I 10
|
||||
#define SUN_F1 -2
|
||||
#define SUN_F2 7
|
||||
#define SUN_PI 399
|
||||
|
||||
/* test_list_t case values */
|
||||
#define TL_NULL 0
|
||||
#define TL_LIST 1
|
||||
|
||||
/* encu_t case values */
|
||||
#define ENCU_I 27
|
||||
#define ENCU_F 0
|
23
rostests/winetests/rpcrt4/testlist.c
Normal file
23
rostests/winetests/rpcrt4/testlist.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* Automatically generated file; DO NOT EDIT!! */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#define STANDALONE
|
||||
#include "wine/test.h"
|
||||
|
||||
extern void func_cstub(void);
|
||||
extern void func_generated(void);
|
||||
extern void func_ndr_marshall(void);
|
||||
extern void func_rpc(void);
|
||||
extern void func_server(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "cstub", func_cstub },
|
||||
{ "generated", func_generated },
|
||||
{ "ndr_marshall", func_ndr_marshall },
|
||||
{ "rpc", func_rpc },
|
||||
{ "server", func_server },
|
||||
{ 0, 0 }
|
||||
};
|
Loading…
Reference in a new issue