Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-python
[jelmer/samba4-debian.git] / source / librpc / idl / spoolss.idl
index e1cd336287cb554c68405f62f0861ef5f0500cfa..7d40861a52622801e0bb6751f9eb94e52b37e4b0 100644 (file)
@@ -3,6 +3,7 @@
 /*
   spoolss interface definitions
 */
+import "security.idl", "winreg.idl";
 
 [ uuid("12345678-1234-abcd-ef00-0123456789ab"),
   version(1.0),
   pointer_default(unique),
   pointer_default_top(unique),
   helpstring("Spooler SubSystem"),
-  depends(security)
+  helper("librpc/ndr/ndr_spoolss_buf.h")
 ] interface spoolss
 {
+       typedef [v1_enum] enum winreg_Type winreg_Type;
        typedef struct {
                uint16 year;
                uint16 month;
@@ -56,7 +58,7 @@
                uint32 unknown29;
        } spoolss_PrinterInfo0;
 
-       typedef [gensize] struct {
+       typedef [public,gensize] struct {
                string32 devicename;
                uint16 specversion;
                uint16 driverversion;
                [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
        } spoolss_DevmodeContainer;
 
-       WERROR spoolss_OpenPrinter(
+       [public] WERROR spoolss_OpenPrinter(
                [in] [string,charset(UTF16)] uint16 *printername,
                [in] [string,charset(UTF16)] uint16 *datatype,
                [in] spoolss_DevmodeContainer devmode_ctr,
 
        /******************/
        /* Function: 0x08 */
-       WERROR spoolss_GetPrinter(
+       [public] WERROR spoolss_GetPrinter(
                [in,ref] policy_handle *handle,
                [in]     uint32 level,
                [in]     DATA_BLOB *buffer,
                [default] spoolss_DriverDirectoryInfo1 info1;
        } spoolss_DriverDirectoryInfo;
 
-       WERROR spoolss_GetPrinterDriverDirectory(
+       [public] WERROR spoolss_GetPrinterDriverDirectory(
                [in] [string,charset(UTF16)] uint16 *server,
                [in] [string,charset(UTF16)] uint16 *environment,
                [in] uint32 level,
                SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7
        } spoolss_PrinterDataType;
 
-       typedef [nodiscriminant,gensize] union {
+       typedef [nodiscriminant,public,gensize] union {
                [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)];
                [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string;
                [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
                [in] spoolss_PrinterDataType type,
                [out,switch_is(type)] spoolss_PrinterData data
        );
-       [nopull,nopush] WERROR spoolss_GetPrinterData(
+       [nopull,nopush,public] WERROR spoolss_GetPrinterData(
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 value_name[],
                [in]     uint32 offered,
 
        /******************/
        /* Function: 0x1d */
-       WERROR spoolss_ClosePrinter(
+       [public] WERROR spoolss_ClosePrinter(
                [in,out,ref]     policy_handle *handle
        );
 
 
        /******************/
        /* Function: 0x38 */
-       WERROR spoolss_FindClosePrinterNotify(
+       [public] WERROR spoolss_FindClosePrinterNotify(
+               [in,ref] policy_handle *handle
        );
 
        /******************/
 
        /******************/
        /* Function: 0x3a */
-       WERROR spoolss_ReplyOpenPrinter(
+       [public] WERROR spoolss_ReplyOpenPrinter(
+               [in,string,charset(UTF16)] uint16 server_name[],
+               [in] uint32 printer_local,
+               [in] winreg_Type type,
+               [in] uint32 unknown1,
+               [in] uint32 unknown2,
+               [out,ref] policy_handle *handle
        );
 
        /******************/
 
        /******************/
        /* Function: 0x3c */
-       WERROR spoolss_ReplyClosePrinter(
+       [public] WERROR spoolss_ReplyClosePrinter(
+               [in,out,ref] policy_handle *handle
        );
 
        /******************/
        WERROR spoolss_ResetPrinterEx(
        );
 
+       typedef [enum16bit] enum {
+               SPOOLSS_FIELD_SERVER_NAME               =  0,
+               SPOOLSS_FIELD_PRINTER_NAME              =  1,
+               SPOOLSS_FIELD_SHARE_NAME        =  2,
+               SPOOLSS_FIELD_PORT_NAME                 =  3,
+               SPOOLSS_FIELD_DRIVER_NAME               =  4,
+               SPOOLSS_FIELD_COMMENT                   =  5,
+               SPOOLSS_FIELD_LOCATION                  =  6,
+               SPOOLSS_FIELD_DEVMODE                   =  7,
+               SPOOLSS_FIELD_SEPFILE                   =  8,
+               SPOOLSS_FIELD_PRINT_PROCESSOR   =  9,
+               SPOOLSS_FIELD_PARAMETERS                = 10,
+               SPOOLSS_FIELD_DATATYPE                  = 11,
+               SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12,
+               SPOOLSS_FIELD_ATTRIBUTES                = 13,
+               SPOOLSS_FIELD_PRIORITY                  = 14,
+               SPOOLSS_FIELD_DEFAULT_PRIORITY  = 15,
+               SPOOLSS_FIELD_START_TIME                = 16,
+               SPOOLSS_FIELD_UNTIL_TIME                = 17,
+               SPOOLSS_FIELD_STATUS                    = 18,
+               SPOOLSS_FIELD_STATUS_STRING             = 19,
+               SPOOLSS_FIELD_CJOBS                             = 20,
+               SPOOLSS_FIELD_AVERAGE_PPM               = 21,
+               SPOOLSS_FIELD_TOTAL_PAGES               = 22,
+               SPOOLSS_FIELD_PAGES_PRINTED     = 23,
+               SPOOLSS_FIELD_TOTAL_BYTES               = 24,
+               SPOOLSS_FIELD_BYTES_PRINTED             = 25
+       } spoolss_Field;
+
+       typedef [enum16bit] enum {
+               SPOOLSS_NOTIFY_PRINTER                  = 0,
+               SPOOLSS_NOTIFY_JOB                              = 1
+       } spoolss_NotifyType;
+
        /******************/
        /* Function: 0x41 */
-       typedef [flag(NDR_PAHEX)] struct {
+       typedef struct {
+               spoolss_NotifyType type;
                uint16 u1;
-               uint16 u2;
+               uint32 u2;
                uint32 u3;
-               uint32 u4;
                uint32 count;
-               [size_is(count)] uint16 *array;
-       } spoolss_RemoteFindFirstPrinterChangeNotifyEx_t2;
+               [size_is(count)] spoolss_Field *fields;
+       } spoolss_NotifyOptionsArray;
 
        typedef struct {
-               uint32 u1;
-               uint32 u2;
+               uint32 version;
+               uint32 flags;
                uint32 count;
-               [size_is(count)] spoolss_RemoteFindFirstPrinterChangeNotifyEx_t2 *t2;
-       } spoolss_RemoteFindFirstPrinterChangeNotifyEx_t1;
+               [size_is(count)] spoolss_NotifyOptionsArray *options;
+       } spoolss_NotifyOptionsContainer;
 
-       WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
+       [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
                [in,ref] policy_handle *handle,
-               [in] uint32 u1,
-               [in] uint32 u2,
+               [in] uint32 flags,
+               [in] uint32 options,
                [in] [string,charset(UTF16)] uint16 *str,
-               [in] uint32 u3,
-               [in] spoolss_RemoteFindFirstPrinterChangeNotifyEx_t1 *t1
+               [in] uint32 printer_local,
+               [in] spoolss_NotifyOptionsContainer *t1
        );
 
        /******************/
        WERROR spoolss_RouterRefreshPrinterChangeNotification(
        );
 
+       typedef struct {
+               uint32 size;
+               [size_is(size/2),unique,charset(UTF16)] uint16 *string;
+       } spoolss_NotifyUTF16String;
+
+       typedef struct {
+               uint32 size;
+               [size_is(size),charset(DOS)] uint8 *string;
+       } spoolss_NotifyDOSString;
+
+       typedef struct {
+               uint16 data[8];
+       } spoolss_NotifyBlobData;
+
+       typedef struct {
+               uint32 len;
+               [unique] spoolss_NotifyBlobData *data;
+       } spoolss_NotifyBlob;
+
+       typedef [switch_type(uint32)] union {
+               [case(1)] dlong integer;
+               [case(2)] spoolss_NotifyUTF16String utf16_string;
+               [case(3)] spoolss_NotifyDOSString ascii_string;
+               [case(4)] spoolss_NotifyBlob blob;
+               [case(5)] spoolss_NotifyDOSString ascii_string;
+       } spoolss_NotifyData;
+
+       typedef struct {
+               spoolss_NotifyType type;
+               spoolss_Field field;
+               uint32 variable_type;
+               uint32 job_id;
+               [switch_is(variable_type)] spoolss_NotifyData data;
+       } spoolss_Notify;
+
+       typedef struct {
+               uint32 version;
+               uint32 flags;
+               uint32 count;
+               [size_is(count)] spoolss_Notify notifies[];
+       } spoolss_NotifyInfo;
+
        /******************/
        /* Function: 0x43 */
-       WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx(
+       [public] WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx(
+               [in,ref] policy_handle *handle,
+               [in] uint32 change_low,
+               [in,unique] spoolss_NotifyOptionsContainer *container,
+               [out, unique] spoolss_NotifyInfo *info
        );
 
        /******************/
                [case(1)]  spoolss_UserLevel1 *level1;
        } spoolss_UserLevel;
 
+       typedef bitmap {
+               SERVER_ACCESS_ADMINISTER        = 0x00000001,
+               SERVER_ACCESS_ENUMERATE         = 0x00000002,
+               PRINTER_ACCESS_ADMINISTER       = 0x00000004,
+               PRINTER_ACCESS_USE              = 0x00000008,
+               JOB_ACCESS_ADMINISTER           = 0x00000010
+       } spoolss_AccessRights;
+
+       /* Access rights for print servers */
+       const int SERVER_ALL_ACCESS     = SEC_STD_REQUIRED |
+                                         SERVER_ACCESS_ADMINISTER |
+                                         SERVER_ACCESS_ENUMERATE;
+
+       const int SERVER_READ           = SEC_STD_READ_CONTROL |
+                                         SERVER_ACCESS_ENUMERATE;
+
+       const int SERVER_WRITE          = STANDARD_RIGHTS_WRITE_ACCESS |
+                                         SERVER_ACCESS_ADMINISTER |
+                                         SERVER_ACCESS_ENUMERATE;
+
+       const int SERVER_EXECUTE        = SEC_STD_READ_CONTROL |
+                                         SERVER_ACCESS_ENUMERATE;
+
+       /* Access rights for printers */
+       const int PRINTER_ALL_ACCESS    = SEC_STD_REQUIRED |
+                                         PRINTER_ACCESS_ADMINISTER |
+                                         PRINTER_ACCESS_USE;
+
+       const int PRINTER_READ          = SEC_STD_READ_CONTROL |
+                                         PRINTER_ACCESS_USE;
+
+       const int PRINTER_WRITE         = STANDARD_RIGHTS_WRITE_ACCESS |
+                                         PRINTER_ACCESS_USE;
+
+       const int PRINTER_EXECUTE       = SEC_STD_READ_CONTROL |
+                                         PRINTER_ACCESS_USE;
+
+       /* Access rights for jobs */
+       const int JOB_ALL_ACCESS        = SEC_STD_REQUIRED |
+                                         JOB_ACCESS_ADMINISTER;
+
+       const int JOB_READ              = SEC_STD_READ_CONTROL |
+                                         JOB_ACCESS_ADMINISTER;
+
+       const int JOB_WRITE             = STANDARD_RIGHTS_WRITE_ACCESS |
+                                         JOB_ACCESS_ADMINISTER;
+
+       const int JOB_EXECUTE           = SEC_STD_READ_CONTROL |
+                                         JOB_ACCESS_ADMINISTER;
+
+       /* ACE masks for various print permissions */
+       const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
+                                               PRINTER_ALL_ACCESS;
+
+       const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
+                                               READ_CONTROL_ACCESS;
+
+       const int PRINTER_ACE_PRINT     = GENERIC_EXECUTE_ACCESS |
+                                         READ_CONTROL_ACCESS |
+                                         PRINTER_ACCESS_USE;
+
        /******************/
        /* Function: 0x45 */
-       WERROR spoolss_OpenPrinterEx(
+       [public] WERROR spoolss_OpenPrinterEx(
                [in]                  [string,charset(UTF16)] uint16 *printername,
                [in]                  [string,charset(UTF16)] uint16 *datatype,
                [in]                  spoolss_DevmodeContainer devmode_ctr,
 
        /******************/
        /* Function: 0x4f */
-       WERROR spoolss_EnumPrinterDataEx(
+       [public] WERROR spoolss_EnumPrinterDataEx(
                [in,ref] policy_handle *handle,
                [in]     [string,charset(UTF16)] uint16 key_name[],
                [in]     uint32 offered,
 
        /******************/
        /* Function: 0x50 */
-       WERROR spoolss_EnumPrinterKey(
+       [public] WERROR spoolss_EnumPrinterKey(
+               [in, ref] policy_handle *handle,
+               [in] [string,charset(UTF16)] uint16 key_name[],
+               [out] uint32 key_buffer_size,
+               [out] uint16 key_buffer[key_buffer_size],
+               [in,out] uint32 needed
        );
 
        /******************/
 
        /******************/
        /* Function: 0x58 */
-       WERROR spoolss_58(
+       WERROR spoolss_XcvData(
+               [in,ref] policy_handle *handle,
+               [in] [string,charset(UTF16)] uint16 function_name[],
+               [in] DATA_BLOB in_data,
+               [in,value(r->in.in_data.length)] uint32 _in_data_length,
+               [in] uint32 offered,
+               [in] uint32 unknown1,
+               [out] DATA_BLOB out_data,
+               [out] uint32 needed,
+               [out] uint32 unknown2
        );
 
        /******************/
        /* Function: 0x59 */
-       WERROR spoolss_AddPrinterDriverEx(
+       [public] WERROR spoolss_AddPrinterDriverEx(
        );
 
        /******************/