Rediger

Del via


TLSGetServerCertificate function

Returns the certificate of the Remote Desktop license server.

Note

This function has no associated header file or import library. To call this function, you must create a user-defined header file and use the LoadLibrary and GetProcAddress functions to dynamically link to Mstlsapi.dll.

Syntax

DWORD WINAPI TLSGetServerCertificate(
  _In_  TLS_HANDLE hHandle,
  _In_  BOOL       bSignCert,
  _Out_ LPBYTE     *ppbCertBlob,
  _Out_ LPDWORD    lpdwCertBlobLen,
  _Out_ PDWORD     pdwErrCode
);

Parameters

hHandle [in]

Handle to a Remote Desktop license server that is opened by a call to the TLSConnectToLsServer function.

bSignCert [in]

TRUE if signature certificate, FALSE if exchange certificate.

ppbCertBlob [out]

Pointer to a variable that receives a pointer to a buffer that contains the certificate.

lpdwCertBlobLen [out]

Pointer to a variable that receives the size of the certificate that is returned.

pdwErrCode [out]

Pointer to a variable that receives the error code.

LSERVER_S_SUCCESS (0)

Call is successful.

TLS_W_SELFSIGN_CERTIFICATE (4007)

Certificate returned is a self-signed certificate.

TLS_W_TEMP_SELFSIGN_CERT (4009)

Certificate returned is temporary.

TLS_E_ACCESS_DENIED (5003)

Access denied.

TLS_E_ALLOCATE_HANDLE (5007)

Server is too busy to process the request.

TLS_E_NO_CERTIFICATE (5022)

Cannot retrieve a certificate.

Return value

This function returns the following possible return values.

RPC_S_OK

The call succeeded. Check the value of the pdwErrCode parameter to get the return code for the call.

RPC_S_INVALID_ARG

The argument was invalid.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
DLL
Mstlsapi.dll

See also

TLSConnectToLsServer