Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1cb7df8a
Commit
1cb7df8a
authored
Dec 18, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Implement I_RpcGetCurrentCallHandle.
parent
1421c1a4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
rpc_binding.h
dlls/rpcrt4/rpc_binding.h
+2
-0
rpc_server.c
dlls/rpcrt4/rpc_server.c
+4
-2
rpcrt4_main.c
dlls/rpcrt4/rpcrt4_main.c
+31
-6
No files found.
dlls/rpcrt4/rpc_binding.h
View file @
1cb7df8a
...
...
@@ -187,5 +187,7 @@ RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_s
RPC_STATUS
RpcTransport_ParseTopOfTower
(
const
unsigned
char
*
tower_data
,
size_t
tower_size
,
char
**
protseq
,
char
**
networkaddr
,
char
**
endpoint
);
void
RPCRT4_SetThreadCurrentConnection
(
RpcConnection
*
Connection
);
void
RPCRT4_SetThreadCurrentCallHandle
(
RpcBinding
*
Binding
);
RpcBinding
*
RPCRT4_GetThreadCurrentCallHandle
(
void
);
#endif
dlls/rpcrt4/rpc_server.c
View file @
1cb7df8a
...
...
@@ -293,6 +293,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
exception
=
FALSE
;
/* dispatch */
RPCRT4_SetThreadCurrentCallHandle
(
msg
->
Handle
);
__TRY
{
if
(
func
)
func
(
msg
);
}
__EXCEPT
(
rpc_filter
)
{
...
...
@@ -304,6 +305,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
response
=
RPCRT4_BuildFaultHeader
(
msg
->
DataRepresentation
,
RPC2NCA_STATUS
(
status
));
}
__ENDTRY
RPCRT4_SetThreadCurrentCallHandle
(
NULL
);
if
(
!
exception
)
response
=
RPCRT4_BuildResponseHeader
(
msg
->
DataRepresentation
,
...
...
@@ -1127,6 +1129,6 @@ RPC_STATUS WINAPI RpcMgmtSetServerStackSize(ULONG ThreadStackSize)
*/
RPC_BINDING_HANDLE
WINAPI
I_RpcGetCurrentCallHandle
(
void
)
{
FIXM
E
(
"
\n
"
);
return
NULL
;
TRAC
E
(
"
\n
"
);
return
RPCRT4_GetThreadCurrentCallHandle
()
;
}
dlls/rpcrt4/rpcrt4_main.c
View file @
1cb7df8a
...
...
@@ -152,6 +152,7 @@ struct threaddata
CRITICAL_SECTION
cs
;
DWORD
thread_id
;
RpcConnection
*
connection
;
RpcBinding
*
server_binding
;
};
/***********************************************************************
...
...
@@ -188,7 +189,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
DeleteCriticalSection
(
&
tdata
->
cs
);
if
(
tdata
->
connection
)
ERR
(
"tdata->connection should be NULL but is still set to %p
\n
"
,
tdata
);
ERR
(
"tdata->connection should be NULL but is still set to %p
\n
"
,
tdata
->
connection
);
if
(
tdata
->
server_binding
)
ERR
(
"tdata->server_binding should be NULL but is still set to %p
\n
"
,
tdata
->
server_binding
);
HeapFree
(
GetProcessHeap
(),
0
,
tdata
);
}
break
;
...
...
@@ -886,31 +889,53 @@ RPC_STATUS RPC_ENTRY RpcMgmtSetCancelTimeout(LONG Timeout)
return
RPC_S_OK
;
}
void
RPCRT4_SetThreadCurrentConnection
(
RpcConnection
*
Connection
)
static
struct
threaddata
*
get_or_create_threaddata
(
void
)
{
struct
threaddata
*
tdata
=
NtCurrentTeb
()
->
ReservedForNtRpc
;
if
(
!
tdata
)
{
tdata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
tdata
));
if
(
!
tdata
)
return
;
tdata
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
tdata
));
if
(
!
tdata
)
return
NULL
;
InitializeCriticalSection
(
&
tdata
->
cs
);
tdata
->
thread_id
=
GetCurrentThreadId
();
tdata
->
connection
=
Connection
;
EnterCriticalSection
(
&
threaddata_cs
);
list_add_tail
(
&
threaddata_list
,
&
tdata
->
entry
);
LeaveCriticalSection
(
&
threaddata_cs
);
NtCurrentTeb
()
->
ReservedForNtRpc
=
tdata
;
return
;
return
tdata
;
}
return
tdata
;
}
void
RPCRT4_SetThreadCurrentConnection
(
RpcConnection
*
Connection
)
{
struct
threaddata
*
tdata
=
get_or_create_threaddata
();
if
(
!
tdata
)
return
;
EnterCriticalSection
(
&
tdata
->
cs
);
tdata
->
connection
=
Connection
;
LeaveCriticalSection
(
&
tdata
->
cs
);
}
void
RPCRT4_SetThreadCurrentCallHandle
(
RpcBinding
*
Binding
)
{
struct
threaddata
*
tdata
=
get_or_create_threaddata
();
if
(
!
tdata
)
return
;
tdata
->
server_binding
=
Binding
;
}
RpcBinding
*
RPCRT4_GetThreadCurrentCallHandle
(
void
)
{
struct
threaddata
*
tdata
=
get_or_create_threaddata
();
if
(
!
tdata
)
return
NULL
;
return
tdata
->
server_binding
;
}
/******************************************************************************
* RpcCancelThread (rpcrt4.@)
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment