<div class="content" name="SamrSetSecurityObject" uuid="6666a066-58cf-4118-bf4b-dd54ed55ecf0"><p>The SamrSetSecurityObject method sets the access control on
a server, <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a></span>, user, group,
or <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_0387e636-5654-4910-9519-1f8326cf5ec0" data-linktype="relative-path">alias
object</a></span>.</p><dl>
<dd>
<div><pre> long SamrSetSecurityObject(
   [in] SAMPR_HANDLE ObjectHandle,
   [in] SECURITY_INFORMATION SecurityInformation,
   [in] PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor
 );
</pre></div>
</dd></dl><p><b>ObjectHandle: </b>An RPC context handle, as
specified in section <span><a href="8138c078-d881-4d1f-b378-94b4c34a287a" data-linktype="relative-path">2.2.7.2</a></span>,
representing a server, domain, user, group, or alias object.</p><p><b>SecurityInformation: </b>A bit field that
indicates the fields of <i>SecurityDescriptor</i> that are requested to be set.</p><dl>
<dd>
<p>The SECURITY_INFORMATION type is defined in <span><a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a></span>
section <span><a href="../ms-dtyp/23e75ca3-98fd-4396-84e5-86cd9d40d343" data-linktype="relative-path">2.4.7</a></span>.
The following bits are valid; all other bits MUST be zero when sent and ignored
on receipt. If none of the bits below are present, the server MUST return
STATUS_INVALID_PARAMETER.</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>OWNER_SECURITY_INFORMATION 0x00000001</td>
  <td>Refers to the Owner member of the security descriptor.</td>
 </tr><tr>
  <td>GROUP_SECURITY_INFORMATION 0x00000002</td>
  <td>Refers to the Group member of the security descriptor.</td>
 </tr><tr>
  <td>DACL_SECURITY_INFORMATION 0x00000004</td>
  <td>Refers to the DACL of the security descriptor.</td>
 </tr><tr>
  <td>SACL_SECURITY_INFORMATION 0x00000008</td>
  <td>Refers to the system access control list (SACL) of the security descriptor.</td>
 </tr></tbody></table>
</dd></dl><p><b>SecurityDescriptor: </b>A security descriptor
expressing access that is specific to the <i>ObjectHandle</i>.</p><p>This protocol asks the RPC runtime, via the <b>strict_context_handle</b>
attribute, to reject the use of context handles created by a method of a
different RPC interface than this one, as specified in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/38ae9f5a-dac2-46ad-b2b7-9c43f211d9f6" data-linktype="relative-path">3</a></span>.</p><p>Message processing for this method is specified in the
following two sections.</p></div>