1 /*
2  * PROJECT:     ReactOS Printing Stack Marshalling Functions
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     Marshalling definitions for ADDJOB_INFO_* and JOB_INFO_*
5  * COPYRIGHT:   Copyright 2015-2018 Colin Finck (colin@reactos.org)
6  */
7 
8 static const MARSHALLING AddJobInfo1Marshalling = {
9     sizeof(ADDJOB_INFO_1W),
10     {
11         { FIELD_OFFSET(ADDJOB_INFO_1W, Path), RTL_FIELD_SIZE(ADDJOB_INFO_1W, Path), RTL_FIELD_SIZE(ADDJOB_INFO_1W, Path), TRUE },
12         { FIELD_OFFSET(ADDJOB_INFO_1W, JobId), RTL_FIELD_SIZE(ADDJOB_INFO_1W, JobId), RTL_FIELD_SIZE(ADDJOB_INFO_1W, JobId), FALSE },
13         { MAXDWORD, 0, 0, FALSE }
14     }
15 };
16 
17 static const MARSHALLING JobInfo1Marshalling = {
18     sizeof(JOB_INFO_1W),
19     {
20         { FIELD_OFFSET(JOB_INFO_1W, JobId), RTL_FIELD_SIZE(JOB_INFO_1W, JobId), RTL_FIELD_SIZE(JOB_INFO_1W, JobId), FALSE },
21         { FIELD_OFFSET(JOB_INFO_1W, pPrinterName), RTL_FIELD_SIZE(JOB_INFO_1W, pPrinterName), RTL_FIELD_SIZE(JOB_INFO_1W, pPrinterName), TRUE },
22         { FIELD_OFFSET(JOB_INFO_1W, pMachineName), RTL_FIELD_SIZE(JOB_INFO_1W, pMachineName), RTL_FIELD_SIZE(JOB_INFO_1W, pMachineName), TRUE },
23         { FIELD_OFFSET(JOB_INFO_1W, pUserName), RTL_FIELD_SIZE(JOB_INFO_1W, pUserName), RTL_FIELD_SIZE(JOB_INFO_1W, pUserName), TRUE },
24         { FIELD_OFFSET(JOB_INFO_1W, pDocument), RTL_FIELD_SIZE(JOB_INFO_1W, pDocument), RTL_FIELD_SIZE(JOB_INFO_1W, pDocument), TRUE },
25         { FIELD_OFFSET(JOB_INFO_1W, pDatatype), RTL_FIELD_SIZE(JOB_INFO_1W, pDatatype), RTL_FIELD_SIZE(JOB_INFO_1W, pDatatype), TRUE },
26         { FIELD_OFFSET(JOB_INFO_1W, pStatus), RTL_FIELD_SIZE(JOB_INFO_1W, pStatus), RTL_FIELD_SIZE(JOB_INFO_1W, pStatus), TRUE },
27         { FIELD_OFFSET(JOB_INFO_1W, Status), RTL_FIELD_SIZE(JOB_INFO_1W, Status), RTL_FIELD_SIZE(JOB_INFO_1W, Status), FALSE },
28         { FIELD_OFFSET(JOB_INFO_1W, Priority), RTL_FIELD_SIZE(JOB_INFO_1W, Priority), RTL_FIELD_SIZE(JOB_INFO_1W, Priority), FALSE },
29         { FIELD_OFFSET(JOB_INFO_1W, Position), RTL_FIELD_SIZE(JOB_INFO_1W, Position), RTL_FIELD_SIZE(JOB_INFO_1W, Position), FALSE },
30         { FIELD_OFFSET(JOB_INFO_1W, TotalPages), RTL_FIELD_SIZE(JOB_INFO_1W, TotalPages), RTL_FIELD_SIZE(JOB_INFO_1W, TotalPages), FALSE },
31         { FIELD_OFFSET(JOB_INFO_1W, PagesPrinted), RTL_FIELD_SIZE(JOB_INFO_1W, PagesPrinted), RTL_FIELD_SIZE(JOB_INFO_1W, PagesPrinted), FALSE },
32         { FIELD_OFFSET(JOB_INFO_1W, Submitted), RTL_FIELD_SIZE(JOB_INFO_1W, Submitted), sizeof(WORD), FALSE },
33         { MAXDWORD, 0, 0, FALSE }
34     }
35 };
36 
37 static const MARSHALLING JobInfo2Marshalling = {
38     sizeof(JOB_INFO_2W),
39     {
40         { FIELD_OFFSET(JOB_INFO_2W, JobId), RTL_FIELD_SIZE(JOB_INFO_2W, JobId), RTL_FIELD_SIZE(JOB_INFO_2W, JobId), FALSE },
41         { FIELD_OFFSET(JOB_INFO_2W, pPrinterName), RTL_FIELD_SIZE(JOB_INFO_2W, pPrinterName), RTL_FIELD_SIZE(JOB_INFO_2W, pPrinterName), TRUE },
42         { FIELD_OFFSET(JOB_INFO_2W, pMachineName), RTL_FIELD_SIZE(JOB_INFO_2W, pMachineName), RTL_FIELD_SIZE(JOB_INFO_2W, pMachineName), TRUE },
43         { FIELD_OFFSET(JOB_INFO_2W, pUserName), RTL_FIELD_SIZE(JOB_INFO_2W, pUserName), RTL_FIELD_SIZE(JOB_INFO_2W, pUserName), TRUE },
44         { FIELD_OFFSET(JOB_INFO_2W, pDocument), RTL_FIELD_SIZE(JOB_INFO_2W, pDocument), RTL_FIELD_SIZE(JOB_INFO_2W, pDocument), TRUE },
45         { FIELD_OFFSET(JOB_INFO_2W, pNotifyName), RTL_FIELD_SIZE(JOB_INFO_2W, pNotifyName), RTL_FIELD_SIZE(JOB_INFO_2W, pNotifyName), TRUE },
46         { FIELD_OFFSET(JOB_INFO_2W, pDatatype), RTL_FIELD_SIZE(JOB_INFO_2W, pDatatype), RTL_FIELD_SIZE(JOB_INFO_2W, pDatatype), TRUE },
47         { FIELD_OFFSET(JOB_INFO_2W, pPrintProcessor), RTL_FIELD_SIZE(JOB_INFO_2W, pPrintProcessor), RTL_FIELD_SIZE(JOB_INFO_2W, pPrintProcessor), TRUE },
48         { FIELD_OFFSET(JOB_INFO_2W, pParameters), RTL_FIELD_SIZE(JOB_INFO_2W, pParameters), RTL_FIELD_SIZE(JOB_INFO_2W, pParameters), TRUE },
49         { FIELD_OFFSET(JOB_INFO_2W, pDriverName), RTL_FIELD_SIZE(JOB_INFO_2W, pDriverName), RTL_FIELD_SIZE(JOB_INFO_2W, pDriverName), TRUE },
50         { FIELD_OFFSET(JOB_INFO_2W, pDevMode), RTL_FIELD_SIZE(JOB_INFO_2W, pDevMode), RTL_FIELD_SIZE(JOB_INFO_2W, pDevMode), TRUE },
51         { FIELD_OFFSET(JOB_INFO_2W, pStatus), RTL_FIELD_SIZE(JOB_INFO_2W, pStatus), RTL_FIELD_SIZE(JOB_INFO_2W, pStatus), TRUE },
52         { FIELD_OFFSET(JOB_INFO_2W, pSecurityDescriptor), RTL_FIELD_SIZE(JOB_INFO_2W, pSecurityDescriptor), RTL_FIELD_SIZE(JOB_INFO_2W, pSecurityDescriptor), TRUE },
53         { FIELD_OFFSET(JOB_INFO_2W, Status), RTL_FIELD_SIZE(JOB_INFO_2W, Status), RTL_FIELD_SIZE(JOB_INFO_2W, Status), FALSE },
54         { FIELD_OFFSET(JOB_INFO_2W, Priority), RTL_FIELD_SIZE(JOB_INFO_2W, Priority), RTL_FIELD_SIZE(JOB_INFO_2W, Priority), FALSE },
55         { FIELD_OFFSET(JOB_INFO_2W, Position), RTL_FIELD_SIZE(JOB_INFO_2W, Position), RTL_FIELD_SIZE(JOB_INFO_2W, Position), FALSE },
56         { FIELD_OFFSET(JOB_INFO_2W, StartTime), RTL_FIELD_SIZE(JOB_INFO_2W, StartTime), RTL_FIELD_SIZE(JOB_INFO_2W, StartTime), FALSE },
57         { FIELD_OFFSET(JOB_INFO_2W, UntilTime), RTL_FIELD_SIZE(JOB_INFO_2W, UntilTime), RTL_FIELD_SIZE(JOB_INFO_2W, UntilTime), FALSE },
58         { FIELD_OFFSET(JOB_INFO_2W, TotalPages), RTL_FIELD_SIZE(JOB_INFO_2W, TotalPages), RTL_FIELD_SIZE(JOB_INFO_2W, TotalPages), FALSE },
59         { FIELD_OFFSET(JOB_INFO_2W, Size), RTL_FIELD_SIZE(JOB_INFO_2W, Size), RTL_FIELD_SIZE(JOB_INFO_2W, Size), FALSE },
60         { FIELD_OFFSET(JOB_INFO_2W, Submitted), RTL_FIELD_SIZE(JOB_INFO_2W, Submitted), sizeof(WORD), FALSE },
61         { FIELD_OFFSET(JOB_INFO_2W, Time), RTL_FIELD_SIZE(JOB_INFO_2W, Time), RTL_FIELD_SIZE(JOB_INFO_2W, Time), FALSE },
62         { FIELD_OFFSET(JOB_INFO_2W, PagesPrinted), RTL_FIELD_SIZE(JOB_INFO_2W, PagesPrinted), RTL_FIELD_SIZE(JOB_INFO_2W, PagesPrinted), FALSE },
63         { MAXDWORD, 0, 0, FALSE }
64     }
65 };
66 
67 static const MARSHALLING* pJobInfoMarshalling[] = {
68     NULL,
69     &JobInfo1Marshalling,
70     &JobInfo2Marshalling
71 };
72