mirror of
https://github.com/samba-team/samba.git
synced 2025-01-17 02:05:21 +03:00
Added SVC_QUERY_DISP_NAME (corresponding to the GetServiceDisplayName API).
Needed during preliminary part of SAM replication.
This commit is contained in:
parent
c95520eae9
commit
03e722cdf5
@ -2599,6 +2599,10 @@ void make_svc_r_query_svc_config(SVC_R_QUERY_SVC_CONFIG *r_c,
|
||||
QUERY_SERVICE_CONFIG *cfg,
|
||||
uint32 buf_size);
|
||||
void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_struct *ps, int depth);
|
||||
void svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct *ps, int depth);
|
||||
void make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d,
|
||||
char *disp_name, uint32 status);
|
||||
void svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct *ps, int depth);
|
||||
void make_svc_q_close(SVC_Q_CLOSE *q_c, POLICY_HND *hnd);
|
||||
void svc_io_q_close(char *desc, SVC_Q_CLOSE *q_u, prs_struct *ps, int depth);
|
||||
void svc_io_r_close(char *desc, SVC_R_CLOSE *r_u, prs_struct *ps, int depth);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#define SVC_OPEN_SC_MAN 0x0f
|
||||
#define SVC_ENUM_SVCS_STATUS 0x0e
|
||||
#define SVC_QUERY_SVC_CONFIG 0x11
|
||||
#define SVC_QUERY_DISP_NAME 0x14
|
||||
#define SVC_OPEN_SERVICE 0x10
|
||||
#define SVC_CLOSE 0x00
|
||||
|
||||
@ -158,6 +159,26 @@ typedef struct r_svc_query_svc_cfg_info
|
||||
} SVC_R_QUERY_SVC_CONFIG;
|
||||
|
||||
|
||||
/* SVC_Q_QUERY_DISP_NAME */
|
||||
typedef struct q_svc_query_disp_name_info
|
||||
{
|
||||
POLICY_HND scman_pol;
|
||||
UNISTR2 uni_svc_name;
|
||||
uint32 buf_size;
|
||||
|
||||
} SVC_Q_QUERY_DISP_NAME;
|
||||
|
||||
|
||||
/* SVC_R_QUERY_DISP_NAME */
|
||||
typedef struct r_svc_query_disp_name_info
|
||||
{
|
||||
UNISTR2 uni_disp_name;
|
||||
uint32 buf_size;
|
||||
uint32 status;
|
||||
|
||||
} SVC_R_QUERY_DISP_NAME;
|
||||
|
||||
|
||||
/* SVC_Q_CLOSE */
|
||||
typedef struct q_svc_close_info
|
||||
{
|
||||
|
@ -520,6 +520,64 @@ void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_str
|
||||
prs_uint32("status ", ps, depth, &(r_u->status ));
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
reads or writes a structure.
|
||||
********************************************************************/
|
||||
void svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct *ps, int depth)
|
||||
{
|
||||
if (q_u == NULL) return;
|
||||
|
||||
prs_debug(ps, depth, desc, "svc_io_q_query_disp_name");
|
||||
depth++;
|
||||
|
||||
prs_align(ps);
|
||||
|
||||
smb_io_pol_hnd("", &(q_u->scman_pol), ps, depth);
|
||||
prs_align(ps);
|
||||
|
||||
smb_io_unistr2("uni_svc_name", &(q_u->uni_svc_name), 1, ps, depth);
|
||||
prs_align(ps);
|
||||
|
||||
prs_uint32("buf_size", ps, depth, &(q_u->buf_size));
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
makes an SVC_R_QUERY_DISP_NAME structure.
|
||||
********************************************************************/
|
||||
void make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d,
|
||||
char *disp_name, uint32 status)
|
||||
{
|
||||
uint32 len = strlen(disp_name);
|
||||
|
||||
if (r_d == NULL) return;
|
||||
|
||||
DEBUG(5,("make_svc_r_query_disp_name\n"));
|
||||
|
||||
make_unistr2(&(r_d->uni_disp_name), disp_name, len+1);
|
||||
r_d->buf_size = len;
|
||||
|
||||
r_d->status = status;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
reads or writes a structure.
|
||||
********************************************************************/
|
||||
void svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct *ps, int depth)
|
||||
{
|
||||
if (r_u == NULL) return;
|
||||
|
||||
prs_debug(ps, depth, desc, "svc_io_r_query_disp_name");
|
||||
depth++;
|
||||
|
||||
prs_align(ps);
|
||||
|
||||
smb_io_unistr2("uni_disp_name", &(r_u->uni_disp_name), 1, ps, depth);
|
||||
prs_align(ps);
|
||||
|
||||
prs_uint32("buf_size", ps, depth, &(r_u->buf_size));
|
||||
prs_uint32("status ", ps, depth, &(r_u->status ));
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
makes an SVC_Q_CLOSE structure.
|
||||
********************************************************************/
|
||||
|
@ -290,6 +290,44 @@ static void api_svc_enum_svcs_status( uint16 vuid, prs_struct *data,
|
||||
svc_reply_enum_svcs_status(&q_u, rdata);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
svc_reply_query_disp_name
|
||||
********************************************************************/
|
||||
static void svc_reply_query_disp_name(SVC_Q_QUERY_DISP_NAME *q_u,
|
||||
prs_struct *rdata)
|
||||
{
|
||||
SVC_R_QUERY_DISP_NAME r_u;
|
||||
fstring svc_name;
|
||||
uint32 status = 0;
|
||||
|
||||
DEBUG(5,("svc_query_disp_name: %d\n", __LINE__));
|
||||
|
||||
if (find_lsa_policy_by_hnd(&q_u->scman_pol) == -1)
|
||||
{
|
||||
status = 0xC000000 | NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
/* for now display name = service name */
|
||||
unistr2_to_ascii(svc_name, &q_u->uni_svc_name, sizeof(svc_name)-1);
|
||||
make_svc_r_query_disp_name(&r_u, svc_name, status);
|
||||
|
||||
/* store the response in the SMB stream */
|
||||
svc_io_r_query_disp_name("", &r_u, rdata, 0);
|
||||
|
||||
DEBUG(5,("svc_query_disp_name: %d\n", __LINE__));
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
api_svc_query_disp_name
|
||||
********************************************************************/
|
||||
static void api_svc_query_disp_name( uint16 vuid, prs_struct *data,
|
||||
prs_struct *rdata )
|
||||
{
|
||||
SVC_Q_QUERY_DISP_NAME q_u;
|
||||
svc_io_q_query_disp_name("", &q_u, data, 0);
|
||||
svc_reply_query_disp_name(&q_u, rdata);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
array of \PIPE\svcctl operations
|
||||
********************************************************************/
|
||||
@ -299,6 +337,7 @@ static struct api_struct api_svc_cmds[] =
|
||||
{ "SVC_OPEN_SC_MAN" , SVC_OPEN_SC_MAN , api_svc_open_sc_man },
|
||||
{ "SVC_OPEN_SERVICE" , SVC_OPEN_SERVICE , api_svc_open_service },
|
||||
{ "SVC_ENUM_SVCS_STATUS", SVC_ENUM_SVCS_STATUS, api_svc_enum_svcs_status },
|
||||
{ "SVC_QUERY_DISP_NAME" , SVC_QUERY_DISP_NAME , api_svc_query_disp_name },
|
||||
{ NULL , 0 , NULL }
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user