enum ndr_err_code ndr_err;
struct spoolss_OSVersion os;
- os.major = 5; /* Windows 2000 == 5.0 */
- os.minor = 0;
- os.build = 2195; /* build */
+ os.major = lp_parm_int(GLOBAL_SECTION_SNUM,
+ "spoolss", "os_major", 5);
+ /* Windows 2000 == 5.0 */
+ os.minor = lp_parm_int(GLOBAL_SECTION_SNUM,
+ "spoolss", "os_minor", 0);
+ os.build = lp_parm_int(GLOBAL_SECTION_SNUM,
+ "spoolss", "os_build", 2195);
os.extra_string = ""; /* leave extra string empty */
ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &os,
return WERR_GENERAL_FAILURE;
}
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_DEBUG(spoolss_OSVersion, &os);
+ }
+
*type = REG_BINARY;
data->binary = blob;
listed. Windows responds to this call with a
WERR_CAN_NOT_COMPLETE so we should do the same. */
- if (servername[0] == '\\' && servername[1] == '\\') {
+ if (servername != NULL &&
+ (servername[0] == '\\') && (servername[1] == '\\')) {
s = servername + 2;
}
&array, &num_strings);
}
- if (presult) {
+ if (presult != NULL) {
*presult = array;
+ } else {
+ talloc_free(array);
}
return WERR_OK;
{
struct printer_handle *printer;
WERROR result;
+ uint32_t version = r->in.client_major_version;
int snum;
return WERR_BADFID;
}
+ if (r->in.client_major_version == SPOOLSS_DRIVER_VERSION_2012) {
+ DEBUG(3,("_spoolss_GetPrinterDriver2: v4 driver requested, "
+ "downgrading to v3\n"));
+ version = SPOOLSS_DRIVER_VERSION_200X;
+ }
+
result = construct_printer_driver_info_level(p->mem_ctx,
get_session_info_system(),
p->msg_ctx,
r->in.level, r->out.info,
snum, printer->servername,
r->in.architecture,
- r->in.client_major_version);
+ version);
if (!W_ERROR_IS_OK(result)) {
TALLOC_FREE(r->out.info);
return result;
return WERR_INVALID_HANDLE;
}
- if (r->in.level != 1) {
+ if (r->in.info_ctr->level != 1) {
return WERR_UNKNOWN_LEVEL;
}
- info_1 = r->in.info.info1;
+ info_1 = r->in.info_ctr->info.info1;
/*
* a nice thing with NT is it doesn't listen to what you tell it.
char **path)
{
const char *pservername = NULL;
- const char *long_archi = SPOOLSS_ARCHITECTURE_NT_X86;
+ const char *long_archi;
const char *short_archi;
*path = NULL;
/* environment may be empty */
if (environment && strlen(environment)) {
long_archi = environment;
+ } else {
+ long_archi = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "spoolss", "architecture",
+ SPOOLSS_ARCHITECTURE_NT_X86);
}
/* servername may be empty */
WERROR _spoolss_AddForm(struct pipes_struct *p,
struct spoolss_AddForm *r)
{
- struct spoolss_AddFormInfo1 *form = r->in.info.info1;
+ struct spoolss_AddFormInfo1 *form;
int snum = -1;
WERROR status = WERR_OK;
struct printer_handle *Printer = find_printer_index_by_hnd(p, r->in.handle);
return WERR_ACCESS_DENIED;
}
+ if (r->in.info_ctr->level != 1) {
+ return WERR_INVALID_LEVEL;
+ }
+
+ form = r->in.info_ctr->info.info1;
+ if (!form) {
+ return WERR_INVALID_PARAM;
+ }
+
switch (form->flags) {
case SPOOLSS_FORM_USER:
case SPOOLSS_FORM_BUILTIN:
WERROR _spoolss_SetForm(struct pipes_struct *p,
struct spoolss_SetForm *r)
{
- struct spoolss_AddFormInfo1 *form = r->in.info.info1;
+ struct spoolss_AddFormInfo1 *form;
const char *form_name = r->in.form_name;
int snum = -1;
WERROR status = WERR_OK;
return WERR_ACCESS_DENIED;
}
+ if (r->in.info_ctr->level != 1) {
+ return WERR_INVALID_LEVEL;
+ }
+
+ form = r->in.info_ctr->info.info1;
+ if (!form) {
+ return WERR_INVALID_PARAM;
+ }
+
tmp_ctx = talloc_new(p->mem_ctx);
if (!tmp_ctx) {
return WERR_NOMEM;