Location: Symbol Reference > Classes > TJwComCustomSecurity Class > TJwComCustomSecurity Methods > TJwComCustomSecurity.CoInitializeSecurity Method
JWSCL Documentation
TJwComCustomSecurity.CoInitializeSecurity Method
class procedure CoInitializeSecurity(pSecDesc: Pointer; cAuthSvc: LONG; asAuthSvc: PSOLE_AUTHENTICATION_SERVICE; dwAuthnLevel: TJwComAuthenticationLevel; dwImpLevel: TJwComImpersonationLevel; pAuthList: Pointer; dwCapabilities: TJwComAuthenticationCapabilities; IgnoreProcess: Boolean); virtual;
pSecDesc: Pointer 
See the MSDN for more information. __in_opt __in 
cAuthSvc: LONG 
See the MSDN for more information. __in_opt 
See the MSDN for more information. __in 
dwAuthnLevel: TJwComAuthenticationLevel 
dwAuthnLevel defines two different things for Client and Server.
  1. Server: It defines the lowest authentication level allowed to connect to the server. Lower levels are rejected.
  2. Client: It defines the authentication level wished to be used by the client. If it is higher than the auth level set by the server, the client's level is used. The higher the better. However, on my Win2008 and RPC_C_AUTHN_WINNT, the highest available level (RPC_C_AUTHN_LEVEL_PKT_PRIVACY) was used by default. Even if set a level too low in a call to CoInitializeSecurity, this high level was used. I could not make it smaller by setting a proxy on the interface. Only RPC_C_AUTHN_LEVEL_NONE turns off all authentication.
dwImpLevel: TJwComImpersonationLevel 
See the MSDN for more information. __in_opt 
pAuthList: Pointer 
See the MSDN for more information. __in 
IgnoreProcess: Boolean 
Set to false to validate the current process name; otherwise the validation isn't done. See Remarks for more information. 

The method CoInitializeSecurity wraps the COM API CoInitializeSecurity using converted parameters and exceptions. See the MSDN for more information. 


If parameter IgnoreProcess is set to false the method checks whether the current process can be found in the array JwKnownComHostProcesses. If this check succeeds the exception EJwsclProcessNotFound is raised.

The current process name was found in the list JwKnownComHostProcesses
The CoInitializeSecurity failed because CoInitialize was not called at first. 
CoInitializeSecurity failed of another reason. 
Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!