Commit 45f9ab92 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

winspool: Declare JobW as a void pointer in SetJobA.

To reduce the number of casts required and avoid a scan-build warning.
parent 044fbbd5
...@@ -2979,7 +2979,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, ...@@ -2979,7 +2979,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level,
LPBYTE pJob, DWORD Command) LPBYTE pJob, DWORD Command)
{ {
BOOL ret; BOOL ret;
LPBYTE JobW; void *JobW;
UNICODE_STRING usBuffer; UNICODE_STRING usBuffer;
TRACE("(%p, %ld, %ld, %p, %ld)\n",hPrinter, JobId, Level, pJob, Command); TRACE("(%p, %ld, %ld, %p, %ld)\n",hPrinter, JobId, Level, pJob, Command);
...@@ -2996,7 +2996,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, ...@@ -2996,7 +2996,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level,
JOB_INFO_1W *info1W = malloc(sizeof(*info1W)); JOB_INFO_1W *info1W = malloc(sizeof(*info1W));
JOB_INFO_1A *info1A = (JOB_INFO_1A*)pJob; JOB_INFO_1A *info1A = (JOB_INFO_1A*)pJob;
JobW = (LPBYTE)info1W; JobW = info1W;
info1W->pUserName = asciitounicode(&usBuffer, info1A->pUserName); info1W->pUserName = asciitounicode(&usBuffer, info1A->pUserName);
info1W->pDocument = asciitounicode(&usBuffer, info1A->pDocument); info1W->pDocument = asciitounicode(&usBuffer, info1A->pDocument);
info1W->pDatatype = asciitounicode(&usBuffer, info1A->pDatatype); info1W->pDatatype = asciitounicode(&usBuffer, info1A->pDatatype);
...@@ -3012,7 +3012,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, ...@@ -3012,7 +3012,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level,
JOB_INFO_2W *info2W = malloc(sizeof(*info2W)); JOB_INFO_2W *info2W = malloc(sizeof(*info2W));
JOB_INFO_2A *info2A = (JOB_INFO_2A*)pJob; JOB_INFO_2A *info2A = (JOB_INFO_2A*)pJob;
JobW = (LPBYTE)info2W; JobW = info2W;
info2W->pUserName = asciitounicode(&usBuffer, info2A->pUserName); info2W->pUserName = asciitounicode(&usBuffer, info2A->pUserName);
info2W->pDocument = asciitounicode(&usBuffer, info2A->pDocument); info2W->pDocument = asciitounicode(&usBuffer, info2A->pDocument);
info2W->pNotifyName = asciitounicode(&usBuffer, info2A->pNotifyName); info2W->pNotifyName = asciitounicode(&usBuffer, info2A->pNotifyName);
...@@ -3045,7 +3045,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, ...@@ -3045,7 +3045,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level,
{ {
case 1: case 1:
{ {
JOB_INFO_1W *info1W = (JOB_INFO_1W*)JobW; JOB_INFO_1W *info1W = JobW;
free(info1W->pUserName); free(info1W->pUserName);
free(info1W->pDocument); free(info1W->pDocument);
free(info1W->pDatatype); free(info1W->pDatatype);
...@@ -3054,7 +3054,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, ...@@ -3054,7 +3054,7 @@ BOOL WINAPI SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level,
} }
case 2: case 2:
{ {
JOB_INFO_2W *info2W = (JOB_INFO_2W*)JobW; JOB_INFO_2W *info2W = JobW;
free(info2W->pUserName); free(info2W->pUserName);
free(info2W->pDocument); free(info2W->pDocument);
free(info2W->pNotifyName); free(info2W->pNotifyName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment