Author: cfinck
Date: Fri Jul 17 15:09:31 2015
New Revision: 68413
URL:
http://svn.reactos.org/svn/reactos?rev=68413&view=rev
Log:
[SPOOLSV, WINSPOOL]
Add MarshallUp/MarshallDown functions for ADDJOB_INFO_1W as well.
Modified:
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/spoolsv/jobs.c
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/jobs.c
Modified:
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/spoolsv/jobs.c
URL:
http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/rea…
==============================================================================
---
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/spoolsv/jobs.c [iso-8859-1]
(original)
+++
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/spoolsv/jobs.c [iso-8859-1]
Fri Jul 17 15:09:31 2015
@@ -6,6 +6,13 @@
*/
#include "precomp.h"
+
+static void
+_MarshallDownAddJobInfo(PADDJOB_INFO_1W pAddJobInfo1)
+{
+ // Replace absolute pointer addresses in the output by relative offsets.
+ pAddJobInfo1->Path = (PWSTR)((ULONG_PTR)pAddJobInfo1->Path -
(ULONG_PTR)pAddJobInfo1);
+}
static void
_MarshallDownJobInfo(PBYTE pJobInfo, DWORD Level)
@@ -53,7 +60,6 @@
_RpcAddJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD Level, BYTE* pAddJob, DWORD cbBuf,
DWORD* pcbNeeded)
{
DWORD dwErrorCode;
- PADDJOB_INFO_1W pAddJobInfo1;
dwErrorCode = RpcImpersonateClient(NULL);
if (dwErrorCode != ERROR_SUCCESS)
@@ -66,11 +72,7 @@
dwErrorCode = GetLastError();
if (dwErrorCode == ERROR_SUCCESS)
- {
- // Replace absolute pointer addresses in the output by relative offsets.
- pAddJobInfo1 = (PADDJOB_INFO_1W)pAddJob;
- pAddJobInfo1->Path = (PWSTR)((ULONG_PTR)pAddJobInfo1->Path -
(ULONG_PTR)pAddJobInfo1);
- }
+ _MarshallDownAddJobInfo((PADDJOB_INFO_1W)pAddJob);
RpcRevertToSelf();
return dwErrorCode;
Modified:
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/jobs.c
URL:
http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/rea…
==============================================================================
---
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/jobs.c [iso-8859-1]
(original)
+++
branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/jobs.c [iso-8859-1]
Fri Jul 17 15:09:31 2015
@@ -6,6 +6,13 @@
*/
#include "precomp.h"
+
+static void
+_MarshallUpAddJobInfo(PADDJOB_INFO_1W pAddJobInfo1)
+{
+ // Replace relative offset addresses in the output by absolute pointers.
+ pAddJobInfo1->Path = (PWSTR)((ULONG_PTR)pAddJobInfo1->Path +
(ULONG_PTR)pAddJobInfo1);
+}
static void
_MarshallUpJobInfo(PBYTE pJobInfo, DWORD Level)
@@ -60,7 +67,6 @@
AddJobW(HANDLE hPrinter, DWORD Level, PBYTE pData, DWORD cbBuf, PDWORD pcbNeeded)
{
DWORD dwErrorCode;
- PADDJOB_INFO_1W pAddJobInfo1;
PSPOOLER_HANDLE pHandle = (PSPOOLER_HANDLE)hPrinter;
if (!pHandle)
@@ -82,11 +88,7 @@
RpcEndExcept;
if (dwErrorCode == ERROR_SUCCESS)
- {
- // Replace relative offset addresses in the output by absolute pointers.
- pAddJobInfo1 = (PADDJOB_INFO_1W)pData;
- pAddJobInfo1->Path = (PWSTR)((ULONG_PTR)pAddJobInfo1->Path +
(ULONG_PTR)pAddJobInfo1);
- }
+ _MarshallUpAddJobInfo((PADDJOB_INFO_1W)pData);
Cleanup:
SetLastError(dwErrorCode);