********************************************************************/
/* Set printer data over the winreg pipe. */
-WERROR winreg_set_printer_dataex(struct pipes_struct *p,
+WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
const char *value,
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
DEBUG(8, ("winreg_set_printer_dataex: Open printer key %s, value %s, access_mask: 0x%05x for [%s]\n",
key, value, access_mask, printer));
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
path,
key,
}
/* Get printer data over a winreg pipe. */
-WERROR winreg_get_printer_dataex(struct pipes_struct *p,
+WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
const char *value,
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
path,
key,
*type = type_in;
*data_size = data_in_size;
if (data_in_size) {
- *data = talloc_move(p->mem_ctx, &data_in);
+ *data = talloc_move(mem_ctx, &data_in);
}
result = WERR_OK;
}
/* Enumerate on the values of a given key and provide the data. */
-WERROR winreg_enum_printer_dataex(struct pipes_struct *p,
+WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
uint32_t *pnum_values,
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
}
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
path,
key,
*pnum_values = num_values;
if (penum_values) {
- *penum_values = talloc_move(p->mem_ctx, &enum_values);
+ *penum_values = talloc_move(mem_ctx, &enum_values);
}
result = WERR_OK;
}
/* Delete printer data over a winreg pipe. */
-WERROR winreg_delete_printer_dataex(struct pipes_struct *p,
+WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
const char *value)
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
path,
key,
}
/* Enumerate on the subkeys of a given key and provide the data. */
-WERROR winreg_enum_printer_key(struct pipes_struct *p,
+WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
uint32_t *pnum_subkeys,
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
path,
key,
*pnum_subkeys = num_subkeys;
if (psubkeys) {
- *psubkeys = talloc_move(p->mem_ctx, &subkeys);
+ *psubkeys = talloc_move(mem_ctx, &subkeys);
}
result = WERR_OK;
}
/* Delete a key with subkeys of a given printer. */
-WERROR winreg_delete_printer_key(struct pipes_struct *p,
+WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key)
{
WERROR result;
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
}
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
path,
key,
* http://unixwiz.net/techtips/winspooler-forms.html
*/
-WERROR winreg_printer_addform1(struct pipes_struct *p,
+WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
struct spoolss_AddFormInfo1 *form)
{
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
TOP_LEVEL_CONTROL_FORMS_KEY,
"",
goto done;
}
- result = winreg_printer_enumforms1(p, &num_info, &info);
+ result = winreg_printer_enumforms1(tmp_ctx, server_info, &num_info, &info);
if (!W_ERROR_IS_OK(result)) {
DEBUG(0, ("winreg_printer_addform: Could not enum keys %s: %s\n",
TOP_LEVEL_CONTROL_FORMS_KEY, win_errstr(result)));
return result;
}
-WERROR winreg_printer_enumforms1(struct pipes_struct *p,
+WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
uint32_t *pnum_info,
union spoolss_FormInfo **pinfo)
{
WERROR result;
TALLOC_CTX *tmp_ctx;
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
TOP_LEVEL_CONTROL_FORMS_KEY,
"",
*pnum_info = num_builtin + num_values;
if (pinfo) {
- *pinfo = talloc_move(p->mem_ctx, &info);
+ *pinfo = talloc_move(mem_ctx, &info);
}
done:
return result;
}
-WERROR winreg_printer_deleteform1(struct pipes_struct *p,
+WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *form_name)
{
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
}
}
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
TOP_LEVEL_CONTROL_FORMS_KEY,
"",
return result;
}
-WERROR winreg_printer_setform1(struct pipes_struct *p,
+WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *form_name,
struct spoolss_AddFormInfo1 *form)
{
}
}
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
TOP_LEVEL_CONTROL_FORMS_KEY,
"",
/* If form_name != form->form_name then we renamed the form */
if (strequal(form_name, form->form_name)) {
- result = winreg_printer_deleteform1(p, form_name);
+ result = winreg_printer_deleteform1(tmp_ctx, server_info, form_name);
if (!W_ERROR_IS_OK(result)) {
DEBUG(0, ("winreg_printer_setform1: Could not open key %s: %s\n",
TOP_LEVEL_CONTROL_FORMS_KEY, win_errstr(result)));
return result;
}
-WERROR winreg_printer_getform1(struct pipes_struct *p,
+WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *form_name,
struct spoolss_FormInfo1 *r)
{
}
}
- tmp_ctx = talloc_new(p->mem_ctx);
+ tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
return WERR_NOMEM;
}
ZERO_STRUCT(key_hnd);
result = winreg_printer_openkey(tmp_ctx,
- p->server_info,
+ server_info,
&winreg_pipe,
TOP_LEVEL_CONTROL_FORMS_KEY,
"",
goto done;
}
- r->form_name = talloc_strdup(p->mem_ctx, form_name);
+ r->form_name = talloc_strdup(mem_ctx, form_name);
if (r->form_name == NULL) {
result = WERR_NOMEM;
goto done;
* @return On success WERR_OK, a corresponding DOS error is
* something went wrong.
*/
-WERROR winreg_set_printer_dataex(struct pipes_struct *p,
+WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
const char *value,
* @return On success WERR_OK, a corresponding DOS error is
* something went wrong.
*/
-WERROR winreg_get_printer_dataex(struct pipes_struct *p,
+WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
const char *value,
* @return WERR_OK on success, the corresponding DOS error
* code if something gone wrong.
*/
-WERROR winreg_enum_printer_dataex(struct pipes_struct *p,
+WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
uint32_t *pnum_values,
* @return On success WERR_OK, a corresponding DOS error is
* something went wrong.
*/
-WERROR winreg_delete_printer_dataex(struct pipes_struct *p,
+WERROR winreg_delete_printer_dataex(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
const char *value);
* @return WERR_OK on success, the corresponding DOS error
* code if something gone wrong.
*/
-WERROR winreg_enum_printer_key(struct pipes_struct *p,
+WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key,
uint32_t *pnum_subkeys,
* @return On success WERR_OK, a corresponding DOS error is
* something went wrong.
*/
-WERROR winreg_delete_printer_key(struct pipes_struct *p,
+WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *printer,
const char *key);
* builtin form.
* A corresponding DOS error is something went wrong.
*/
-WERROR winreg_printer_addform1(struct pipes_struct *p,
+WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
struct spoolss_AddFormInfo1 *form);
/*
* @return On success WERR_OK, a corresponding DOS error is
* something went wrong.
*/
-WERROR winreg_printer_enumforms1(struct pipes_struct *p,
+WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
uint32_t *pnum_info,
union spoolss_FormInfo **pinfo);
* WERR_INVALID_PARAM if the form is a builtin form.
* A corresponding DOS error is something went wrong.
*/
-WERROR winreg_printer_deleteform1(struct pipes_struct *p,
+WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *form_name);
/**
* WERR_INVALID_PARAM if the form is a builtin form.
* A corresponding DOS error is something went wrong.
*/
-WERROR winreg_printer_setform1(struct pipes_struct *p,
+WERROR winreg_printer_setform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *form_name,
struct spoolss_AddFormInfo1 *form);
* @return On success WERR_OK, a corresponding DOS error is
* something went wrong.
*/
-WERROR winreg_printer_getform1(struct pipes_struct *p,
+WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info *server_info,
const char *form_name,
struct spoolss_FormInfo1 *form);