{
struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, server->ntptr->lp_ctx);
if (strcmp("W3SvcInstalled", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 0;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 0;
return WERR_OK;
} else if (strcmp("BeepEnabled", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 0;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 0;
return WERR_OK;
} else if (strcmp("EventLog", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 0;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 0;
return WERR_OK;
} else if (strcmp("NetPopup", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 0;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 0;
return WERR_OK;
} else if (strcmp("NetPopupToComputer", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 0;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 0;
return WERR_OK;
} else if (strcmp("MajorVersion", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 3;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 3;
return WERR_OK;
} else if (strcmp("MinorVersion", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 0;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 0;
return WERR_OK;
} else if (strcmp("DefaultSpoolDirectory", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
- r->out.data.string = "C:\\PRINTERS";
+ *r->out.type = REG_SZ;
+ r->out.data->string = "C:\\PRINTERS";
return WERR_OK;
} else if (strcmp("Architecture", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
- r->out.data.string = SPOOLSS_ARCHITECTURE_NT_X86;
+ *r->out.type = REG_SZ;
+ r->out.data->string = SPOOLSS_ARCHITECTURE_NT_X86;
return WERR_OK;
} else if (strcmp("DsPresent", r->in.value_name) == 0) {
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
- r->out.data.value = 1;
+ *r->out.type = REG_DWORD;
+ r->out.data->value = 1;
return WERR_OK;
} else if (strcmp("OSVersion", r->in.value_name) == 0) {
DATA_BLOB blob;
return WERR_GENERAL_FAILURE;
}
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
- r->out.data.binary = blob;
+ *r->out.type = REG_BINARY;
+ r->out.data->binary = blob;
return WERR_OK;
} else if (strcmp("OSVersionEx", r->in.value_name) == 0) {
DATA_BLOB blob;
os_ex.major = server_info->version_major;
os_ex.minor = server_info->version_minor;
os_ex.build = server_info->version_build;
- os_ex.extra_string = "";
- os_ex.unknown2 = 0;
- os_ex.unknown3 = 0;
+ os_ex.extra_string = "";
+ os_ex.service_pack_major= 0;
+ os_ex.service_pack_minor= 0;
+ os_ex.suite_mask = 0;
+ os_ex.product_type = 0;
+ os_ex.reserved = 0;
ndr_err = ndr_push_struct_blob(&blob, mem_ctx, lp_iconv_convenience(server->ntptr->lp_ctx), &os_ex, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
return WERR_GENERAL_FAILURE;
}
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
- r->out.data.binary = blob;
+ *r->out.type = REG_BINARY;
+ r->out.data->binary = blob;
return WERR_OK;
} else if (strcmp("DNSMachineName", r->in.value_name) == 0) {
if (!lp_realm(server->ntptr->lp_ctx)) return WERR_INVALID_PARAM;
- *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
- r->out.data.string = talloc_asprintf(mem_ctx, "%s.%s",
+ *r->out.type = REG_SZ;
+ r->out.data->string = talloc_asprintf(mem_ctx, "%s.%s",
lp_netbios_name(server->ntptr->lp_ctx),
lp_realm(server->ntptr->lp_ctx));
- W_ERROR_HAVE_NO_MEMORY(r->out.data.string);
+ W_ERROR_HAVE_NO_MEMORY(r->out.data->string);
return WERR_OK;
}
return WERR_UNKNOWN_LEVEL;
}
- r->out.info = info;
+ *r->out.info = info;
*r->out.count = count;
return WERR_OK;
}
return WERR_UNKNOWN_LEVEL;
}
- r->out.info = info;
+ *r->out.info = info;
*r->out.count = count;
return WERR_OK;
}
return WERR_UNKNOWN_LEVEL;
}
- r->out.info = info;
+ *r->out.info = info;
*r->out.count = count;
return WERR_OK;
}
return WERR_UNKNOWN_LEVEL;
}
- r->out.info = info;
+ *r->out.info = info;
*r->out.count = count;
return WERR_OK;
}
return WERR_OK;
}
+static WERROR sptr_GetPrintProcessorDirectory(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
+ struct spoolss_GetPrintProcessorDirectory *r)
+{
+ union spoolss_PrintProcessorDirectoryInfo *info;
+ const char *prefix;
+ const char *postfix;
+
+ /*
+ * NOTE: normally r->in.level is 1, but both w2k3 and nt4 sp6a
+ * are ignoring the r->in.level completely, so we do :-)
+ */
+
+ /*
+ * TODO: check the server name is ours
+ * - if it's a invalid UNC then return WERR_INVALID_NAME
+ * - if it's the wrong host name return WERR_INVALID_PARAM
+ * - if it's "" then we need to return a local WINDOWS path
+ */
+ if (!r->in.server || !r->in.server[0]) {
+ prefix = "C:\\PRTPROCS";
+ } else {
+ prefix = talloc_asprintf(mem_ctx, "%s\\prnproc$", r->in.server);
+ W_ERROR_HAVE_NO_MEMORY(prefix);
+ }
+
+ if (r->in.environment && strcmp(SPOOLSS_ARCHITECTURE_NT_X86, r->in.environment) == 0) {
+ postfix = "W32X86";
+ } else {
+ return WERR_INVALID_ENVIRONMENT;
+ }
+
+ info = talloc(mem_ctx, union spoolss_PrintProcessorDirectoryInfo);
+ W_ERROR_HAVE_NO_MEMORY(info);
+
+ info->info1.directory_name = talloc_asprintf(mem_ctx, "%s\\%s", prefix, postfix);
+ W_ERROR_HAVE_NO_MEMORY(info->info1.directory_name);
+
+ r->out.info = info;
+ return WERR_OK;
+}
+
/*
initialialise the simble ldb backend, registering ourselves with the ntptr subsystem
/* PrintProcessor functions */
/* .EnumPrintProcessors = sptr_EnumPrintProcessors,
*/
+ .GetPrintProcessorDirectory = sptr_GetPrintProcessorDirectory,
+
/* Printer functions */
.EnumPrinters = sptr_EnumPrinters,
.OpenPrinter = sptr_OpenPrinter,