1*f3ea8225SColin Finck /*
2*f3ea8225SColin Finck  * PROJECT:     ReactOS Printing Stack Marshalling Functions
3*f3ea8225SColin Finck  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4*f3ea8225SColin Finck  * PURPOSE:     Marshalling definitions
5*f3ea8225SColin Finck  * COPYRIGHT:   Copyright 2015-2018 Colin Finck (colin@reactos.org)
6*f3ea8225SColin Finck  */
7*f3ea8225SColin Finck 
8*f3ea8225SColin Finck 
9*f3ea8225SColin Finck #ifndef _MARSHALLING_H
10*f3ea8225SColin Finck #define _MARSHALLING_H
11*f3ea8225SColin Finck 
12*f3ea8225SColin Finck typedef struct _MARSHALLING_INFO
13*f3ea8225SColin Finck {
14*f3ea8225SColin Finck     DWORD dwOffset;             /** Byte offset of this element within the structure or MAXDWORD to indicate the end of the array */
15*f3ea8225SColin Finck     DWORD cbSize;               /** Total size of this element in bytes under Windows. Unused here, I don't know what we need this number for. */
16*f3ea8225SColin Finck     DWORD cbPerElementSize;     /** If this element is a structure itself, this field gives the size in bytes of each element of the structure.
17*f3ea8225SColin Finck                                 Otherwise, this is the same as cbTotalSize. E.g. for SYSTEMTIME, cbSize would be 16 and cbPerElementSize would be 2.
18*f3ea8225SColin Finck                                 Unused here, I don't know what we need this number for. */
19*f3ea8225SColin Finck     BOOL bAdjustAddress;        /** TRUE if MarshallDownStructure shall adjust the address of this element, FALSE if it shall leave this element untouched. */
20*f3ea8225SColin Finck }
21*f3ea8225SColin Finck MARSHALLING_INFO;
22*f3ea8225SColin Finck 
23*f3ea8225SColin Finck typedef struct _MARSHALLING
24*f3ea8225SColin Finck {
25*f3ea8225SColin Finck     DWORD cbStructureSize;
26*f3ea8225SColin Finck     MARSHALLING_INFO pInfo[];
27*f3ea8225SColin Finck }
28*f3ea8225SColin Finck MARSHALLING;
29*f3ea8225SColin Finck 
30*f3ea8225SColin Finck BOOL WINAPI MarshallDownStructure(PVOID pStructure, const MARSHALLING_INFO* pInfo, DWORD cbStructureSize, BOOL bSomeBoolean);
31*f3ea8225SColin Finck BOOL WINAPI MarshallDownStructuresArray(PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO* pInfo, DWORD cbStructureSize, BOOL bSomeBoolean);
32*f3ea8225SColin Finck BOOL WINAPI MarshallUpStructure(DWORD cbSize, PVOID pStructure, const MARSHALLING_INFO* pInfo, DWORD cbStructureSize, BOOL bSomeBoolean);
33*f3ea8225SColin Finck BOOL WINAPI MarshallUpStructuresArray(DWORD cbSize, PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO* pInfo, DWORD cbStructureSize, BOOL bSomeBoolean);
34*f3ea8225SColin Finck 
35*f3ea8225SColin Finck #endif
36