Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

NTSTATUS cli_lsa_open_policy ( struct cli_state *  cli,
TALLOC_CTX mem_ctx,
BOOL  sec_qos,
uint32  des_access,
POLICY_HND *  pol 
)

Open a LSA policy handle

Parameters:
cli Handle on an initialised SMB connection

Definition at line 57 of file cli_lsarpc.c.

Referenced by fetch_domain_sid().

{
      prs_struct qbuf, rbuf;
      LSA_Q_OPEN_POL q;
      LSA_R_OPEN_POL r;
      LSA_SEC_QOS qos;
      NTSTATUS result;

      ZERO_STRUCT(q);
      ZERO_STRUCT(r);

      /* Initialise parse structures */

      prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
      prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);

      /* Initialise input parameters */

      if (sec_qos) {
            init_lsa_sec_qos(&qos, 2, 1, 0);
            init_q_open_pol(&q, '\\', 0, des_access, &qos);
      } else {
            init_q_open_pol(&q, '\\', 0, des_access, NULL);
      }

      /* Marshall data and send request */

      if (!lsa_io_q_open_pol("", &q, &qbuf, 0) ||
          !rpc_api_pipe_req(cli, LSA_OPENPOLICY, &qbuf, &rbuf)) {
            result = NT_STATUS_UNSUCCESSFUL;
            goto done;
      }

      /* Unmarshall response */

      if (!lsa_io_r_open_pol("", &r, &rbuf, 0)) {
            result = NT_STATUS_UNSUCCESSFUL;
            goto done;
      }

      /* Return output parameters */

      if (NT_STATUS_IS_OK(result = r.status)) {
            *pol = r.pol;
      }

 done:
      prs_mem_free(&qbuf);
      prs_mem_free(&rbuf);

      return result;
}


Generated by  Doxygen 1.6.0   Back to index