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

NTSTATUS cli_lsa_lookupprivvalue ( struct cli_state *  cli,
TALLOC_CTX mem_ctx,
POLICY_HND *  pol,
char *  name,
LUID *  luid 
)

Get a privilege value given its name

Definition at line 960 of file cli_lsarpc.c.

{
      prs_struct qbuf, rbuf;
      LSA_Q_LOOKUPPRIVVALUE q;
      LSA_R_LOOKUPPRIVVALUE r;
      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);

      /* Marshall data and send request */

      init_lsa_q_lookupprivvalue(&q, pol, name);

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

      /* Unmarshall response */

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

      if (!NT_STATUS_IS_OK(result = r.status)) {
            goto done;
      }

      /* Return output parameters */

      (*luid).low=r.luid.low;
      (*luid).high=r.luid.high;

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

      return result;
}


Generated by  Doxygen 1.6.0   Back to index