ICertRequest::GetLastStatus method (certcli.h)
The GetLastStatus method gets the last return code for this request. This returns the error code information, rather than the disposition of the request.
Syntax
HRESULT GetLastStatus(
[out] LONG *pStatus
);
Parameters
[out] pStatus
A pointer to the request's status code.
Return value
C++
If the method succeeds, the method returns S_OK.Upon successful completion of this function, *pStatus is set to the result code of the latest call to ICertRequest3::Submit, ICertRequest3::RetrievePending, or ICertRequest3::GetCACertificate.
If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.
VB
The return value is the result code of the latest call to CCertRequest3.Submit, CCertRequest3.RetrievePending or CCertRequest3.GetCACertificate.Remarks
The value retrieved by GetLastStatus depends on the most recent call to ICertRequest3::Submit, ICertRequest3::RetrievePending, or ICertRequest3::GetCACertificate. If a call to one of these methods fails on the server, call GetLastStatus to retrieve the error number. Some server failures (such as denied requests) return S_OK and a disposition other than CR_DISP_ISSUED from the method call, and you can use GetLastStatus to retrieve the specific cause of failure. If a call to one of these methods succeeds, then a subsequent call to GetLastStatus returns S_OK (which is zero).
Additionally, the request disposition is stored in the Certificate Services database, and can be viewed by means of the Certification Authority MMC snap-in (choose the Request Disposition column).
Examples
HRESULT hrServer, hr;
// pCertRequest is previously instantiated
// ICertRequest object pointer.
hr = pCertRequest->GetLastStatus((LONG *) &hrServer);
if (FAILED(hr))
{
printf("Failed GetLastStatus [%x]\n", hr);
goto error;
}
else
{
// Use the HRESULT value as needed...
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | certcli.h (include Certsrv.h) |
Library | Certidl.lib |
DLL | Certcli.dll |