Discussion:
Why does RpcServerUseProtseqEp cause system error 1008?
(too old to reply)
Shwu
2007-08-03 17:47:02 UTC
Permalink
Hello,

My Windows service application implements a RPC server function. After it
calls RpcServerUseProtseqEp, GetLastError returns 1008: "An attempt was made
to reference a token that does not exist." But the function it self returns
RPC_S_OK.
What could be the reason that the function RpcServerUseProtseqEp causes a
system error 1008?

Thanks for any input,

Shangwu
Skywing [MVP]
2007-08-06 19:56:15 UTC
Permalink
The return value of GetLastError is undefined after RpcServerUseProtseqEp.
Unless a function specifies that you may call GetLastError to get meaningful
information, you cannot do so (most Rpc* APIs do not, FYI). Furthermore,
most such functions that do set a last error value only result in a
meaningful last error value when they fail, and not when they succeed.
--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
Post by Shwu
Hello,
My Windows service application implements a RPC server function. After it
calls RpcServerUseProtseqEp, GetLastError returns 1008: "An attempt was
made to reference a token that does not exist." But the function it self
returns RPC_S_OK.
What could be the reason that the function RpcServerUseProtseqEp causes a
system error 1008?
Thanks for any input,
Shangwu
Shwu
2007-08-07 20:54:02 UTC
Permalink
Ken,

Thank you so much for your comment. The reason I am concerning about the
error is that it always causes the service manager showing a popup error
message "error 1008: An attempt was made to reference a token that does not
exist" when my service program is stopped from the service control panel. I
have to call SetLastError(0) to clear the error code before the service
quits in order to stop the annoy error popup.
I wonder something is really wrong after the call of RpcServerUseProtseqEp.

Shangwu
Post by Skywing [MVP]
The return value of GetLastError is undefined after RpcServerUseProtseqEp.
Unless a function specifies that you may call GetLastError to get
meaningful information, you cannot do so (most Rpc* APIs do not, FYI).
Furthermore, most such functions that do set a last error value only
result in a meaningful last error value when they fail, and not when they
succeed.
--
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
Post by Shwu
Hello,
My Windows service application implements a RPC server function. After
it calls RpcServerUseProtseqEp, GetLastError returns 1008: "An attempt
was made to reference a token that does not exist." But the function it
self returns RPC_S_OK.
What could be the reason that the function RpcServerUseProtseqEp causes a
system error 1008?
Thanks for any input,
Shangwu
Loading...