Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WDEnable function

Changes Windows Defender status to on or off.

Syntax


HRESULT WDEnable(
  _In_  BOOL fEnable
);

Parameters

fEnable [in]

Type: BOOL

Windows Defender status that the calling application wants to set. TRUE enables Windows Defender. FALSE disables Windows Defender.

Return value

Type: HRESULT

This function can return one of these values.

Return codeDescription
S_OK

Windows Defender is configured to the state requested.

E_ACCESSDENIED

Calling application does not have sufficient permission or is flagged as a threat by Windows Defender signature database.

Calling application identity is not verifiable through digital signing.

HRESULT_FROM_WIN32(ERROR_ACCESS_DISABLED_BY_POLICY)

Calling application request contradicts with the Windows Defender status set by group policy.

 

Remarks

The application calling this function must run with administrator permissions on the local computer. Windows Defender also validates (1) the proper signing of the calling process and all loaded modules and (2) that the IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY flag is set on the calling process and all loaded modules before allowing the calling application to change the status. If the calling process image (or any loaded modules) is not signed or is flagged as a threat by the Windows Defender signature, then the call fails with the appropriate error code.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Windowsdefender.h

DLL

MpClient.dll

See also

WDStatus

 

 

Community Additions

ADD
Show:
© 2015 Microsoft