Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SetProtectedPolicy function

Sets a protected policy.

Syntax


BOOL WINAPI SetProtectedPolicy(
  _In_  LPCGUID    PolicyGuid,
  _In_  ULONG_PTR  PolicyValue,
  _Out_ PULONG_PTR OldPolicyValue
);

Parameters

PolicyGuid [in]

The globally-unique identifier of the policy to set.

PolicyValue [in]

The value to set the policy to.

OldPolicyValue [out]

Optionally receives the original value that was associated with the supplied policy.

Return value

True if the function succeeds; otherwise, false. To retrieve error values for this function, call GetLastError.

Remarks

Protected policies are process-wide configuration settings that are stored in read-only memory. This is intended to help protect the policy from being corrupted or altered in an unintended way while an application is executing.

To compile an application that calls this function, define _WIN32_WINNT as 0x0603 or later. For more information, see Using the Windows Headers.

This function became available in update 3 (the November 2014 update) for Windows 8.1 and Windows Server 2012 R2.

Requirements

Minimum supported client

Windows 8.1 [desktop apps only]

Minimum supported server

Windows Server 2012 R2 [desktop apps only]

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

 

 

Show:
© 2017 Microsoft