NdfRepairIncident function (ndfapi.h)
The NdfRepairIncident function repairs an incident without displaying a user interface.
Syntax
void NdfRepairIncident(
[in] NDFHANDLE Handle,
[in] RepairInfoEx *RepairEx,
DWORD dwWait
);
Parameters
[in] Handle
Type: NDFHANDLE
Handle to the Network Diagnostics Framework incident. This handle should match the handle passed to NdfDiagnoseIncident.
[in] RepairEx
Type: RepairInfoEx*
A structure (obtained from NdfDiagnoseIncident) which indicates the particular repair to be performed.
Memory allocated to these structures should later be freed. For an example of how to do this, see the Microsoft Windows Network Diagnostics Samples.
dwWait
Type: DWORD
The length of time, in milliseconds, to wait before terminating the diagnostic routine. INFINITE may be passed to this parameter if no timeout is desired.
Return value
Possible return values include, but are not limited to, the following.
Return code | Description |
---|---|
|
Repair succeeded. |
|
The repair executed successfully, but NDF validation still found a connectivity problem. If this value is returned, the session should be closed by calling NdfCloseIncident and another session should be created to continue the diagnosis. |
|
The NDF incident handle is not valid. |
|
The repair operation has terminated because it has taken longer than the time-out specified in dwWait. |
Other failure codes are returned if the repair failed to execute. In that case, the client can call NdfRepairIncident again with a different repair.
Remarks
NdfRepairIncident can only be called when NdfDiagnoseIncident is used for diagnostics. This is typically the case in scenarios where no user interface is shown, or where the standard Windows experience is not being used (as with Media Center and embedded applications). NdfRepairIncident should not be called when NdfExecuteDiagnosis is used.
Before using this API, an application must call an incident creation function such as NdfCreateWebIncident to begin the NDF diagnostics process. The application then calls NdfDiagnoseIncident to diagnose the issue. If the diagnostics process identifies some possible repairs, the application can call NdfRepairIncident to repair the problem without displaying a user interface. NdfCancelIncident can optionally be called from a separate thread if the application wants to cancel an ongoing NdfRepairIncident call. Finally, the application calls NdfCloseIncident.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | ndfapi.h |
Library | Ndfapi.lib |
DLL | Ndfapi.dll |