{
PROCESS_INFORMATION pi;
STARTUPINFOW si;
- static WCHAR cmd[6];
- static const WCHAR rpcss[] = {'r','p','c','s','s',0};
+ WCHAR cmd[MAX_PATH];
+ static const WCHAR rpcss[] = {'\\','r','p','c','s','s','.','e','x','e',0};
BOOL rslt;
+ void *redir;
TRACE("\n");
- ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
ZeroMemory(&si, sizeof(STARTUPINFOA));
si.cb = sizeof(STARTUPINFOA);
+ GetSystemDirectoryW( cmd, MAX_PATH - sizeof(rpcss)/sizeof(WCHAR) );
+ lstrcatW( cmd, rpcss );
- memcpy(cmd, rpcss, sizeof(rpcss));
-
- rslt = CreateProcessW(
- NULL, /* executable */
- cmd, /* command line */
- NULL, /* process security attributes */
- NULL, /* primary thread security attributes */
- FALSE, /* inherit handles */
- 0, /* creation flags */
- NULL, /* use parent's environment */
- NULL, /* use parent's current directory */
- &si, /* STARTUPINFO pointer */
- &pi /* PROCESS_INFORMATION */
- );
+ Wow64DisableWow64FsRedirection( &redir );
+ rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
+ Wow64RevertWow64FsRedirection( redir );
if (rslt)
{
static inline BOOL is_epm_destination_local(RPC_BINDING_HANDLE handle)
{
- RpcBinding *bind = (RpcBinding *)handle;
+ RpcBinding *bind = handle;
const char *protseq = bind->Protseq;
const char *network_addr = bind->NetworkAddr;
- return ((!strcmp(protseq, "ncalrpc") && !network_addr) ||
- (!strcmp(protseq, "ncacn_np") &&
+ return (!strcmp(protseq, "ncalrpc") ||
+ (!strcmp(protseq, "ncacn_np") &&
(!network_addr || !strcmp(network_addr, "."))));
}
static RPC_STATUS get_epm_handle_client(RPC_BINDING_HANDLE handle, RPC_BINDING_HANDLE *epm_handle)
{
- RpcBinding *bind = (RpcBinding *)handle;
+ RpcBinding *bind = handle;
const char * pszEndpoint = NULL;
RPC_STATUS status;
RpcBinding* epm_bind;
status = RpcBindingCopy(handle, epm_handle);
if (status != RPC_S_OK) return status;
- epm_bind = (RpcBinding*)*epm_handle;
+ epm_bind = *epm_handle;
if (epm_bind->AuthInfo)
{
/* don't bother with authenticating against the EPM by default
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *__eptr)
{
- switch (GetExceptionCode())
+ switch (__eptr->ExceptionRecord->ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
case EXCEPTION_ILLEGAL_INSTRUCTION:
RPC_STATUS WINAPI RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector,
UUID_VECTOR *UuidVector, RPC_CSTR Annotation )
{
- PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec;
- unsigned long i;
+ PRPC_SERVER_INTERFACE If = IfSpec;
+ ULONG i;
RPC_STATUS status = RPC_S_OK;
error_status_t status2;
ept_entry_t *entries;
TRACE("(%p,%p,%p,%s)\n", IfSpec, BindingVector, UuidVector, debugstr_a((char*)Annotation));
TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID));
for (i=0; i<BindingVector->Count; i++) {
- RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[i]);
- TRACE(" protseq[%ld]=%s\n", i, debugstr_a(bind->Protseq));
- TRACE(" endpoint[%ld]=%s\n", i, debugstr_a(bind->Endpoint));
+ RpcBinding* bind = BindingVector->BindingH[i];
+ TRACE(" protseq[%d]=%s\n", i, debugstr_a(bind->Protseq));
+ TRACE(" endpoint[%d]=%s\n", i, debugstr_a(bind->Endpoint));
}
if (UuidVector) {
for (i=0; i<UuidVector->Count; i++)
- TRACE(" obj[%ld]=%s\n", i, debugstr_guid(UuidVector->Uuid[i]));
+ TRACE(" obj[%d]=%s\n", i, debugstr_guid(UuidVector->Uuid[i]));
}
if (!BindingVector->Count) return RPC_S_OK;
for (i = 0; i < BindingVector->Count; i++)
{
unsigned j;
- RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[i]);
+ RpcBinding* bind = BindingVector->BindingH[i];
for (j = 0; j < (UuidVector ? UuidVector->Count : 1); j++)
{
- int len = strlen((char *)Annotation);
status = TowerConstruct(&If->InterfaceId, &If->TransferSyntax,
bind->Protseq, bind->Endpoint,
bind->NetworkAddr,
memcpy(&entries[i * UuidVector->Count].object, &UuidVector->Uuid[j], sizeof(GUID));
else
memset(&entries[i].object, 0, sizeof(entries[i].object));
- memcpy(entries[i].annotation, Annotation, min(len + 1, ept_max_annotation_size));
+ if (Annotation)
+ memcpy(entries[i].annotation, Annotation,
+ min(strlen((char *)Annotation) + 1, ept_max_annotation_size));
}
}
return status;
}
+/***********************************************************************
+ * RpcEpRegisterW (RPCRT4.@)
+ */
+RPC_STATUS WINAPI RpcEpRegisterW( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector,
+ UUID_VECTOR *UuidVector, RPC_WSTR Annotation )
+{
+ LPSTR annA = RPCRT4_strdupWtoA(Annotation);
+ RPC_STATUS status;
+
+ status = RpcEpRegisterA(IfSpec, BindingVector, UuidVector, (RPC_CSTR)annA);
+
+ HeapFree(GetProcessHeap(), 0, annA);
+ return status;
+}
+
/***********************************************************************
* RpcEpUnregister (RPCRT4.@)
*/
RPC_STATUS WINAPI RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector,
UUID_VECTOR *UuidVector )
{
- PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec;
- unsigned long i;
+ PRPC_SERVER_INTERFACE If = IfSpec;
+ ULONG i;
RPC_STATUS status = RPC_S_OK;
error_status_t status2;
ept_entry_t *entries;
TRACE("(%p,%p,%p)\n", IfSpec, BindingVector, UuidVector);
TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID));
for (i=0; i<BindingVector->Count; i++) {
- RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[i]);
- TRACE(" protseq[%ld]=%s\n", i, debugstr_a(bind->Protseq));
- TRACE(" endpoint[%ld]=%s\n", i, debugstr_a(bind->Endpoint));
+ RpcBinding* bind = BindingVector->BindingH[i];
+ TRACE(" protseq[%d]=%s\n", i, debugstr_a(bind->Protseq));
+ TRACE(" endpoint[%d]=%s\n", i, debugstr_a(bind->Endpoint));
}
if (UuidVector) {
for (i=0; i<UuidVector->Count; i++)
- TRACE(" obj[%ld]=%s\n", i, debugstr_guid(UuidVector->Uuid[i]));
+ TRACE(" obj[%d]=%s\n", i, debugstr_guid(UuidVector->Uuid[i]));
}
entries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*entries) * BindingVector->Count * (UuidVector ? UuidVector->Count : 1));
for (i = 0; i < BindingVector->Count; i++)
{
unsigned j;
- RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[i]);
+ RpcBinding* bind = BindingVector->BindingH[i];
for (j = 0; j < (UuidVector ? UuidVector->Count : 1); j++)
{
status = TowerConstruct(&If->InterfaceId, &If->TransferSyntax,
*/
RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec )
{
- PRPC_CLIENT_INTERFACE If = (PRPC_CLIENT_INTERFACE)IfSpec;
- RpcBinding* bind = (RpcBinding*)Binding;
+ PRPC_CLIENT_INTERFACE If = IfSpec;
+ RpcBinding* bind = Binding;
RPC_STATUS status;
error_status_t status2;
handle_t handle;