Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
facaee4f
Commit
facaee4f
authored
Jan 03, 2003
by
Stefan Leichter
Committed by
Alexandre Julliard
Jan 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved implementation of GetPrinterDriverDirectory from ascii to unicode.
parent
fa93b446
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
21 deletions
+44
-21
info.c
dlls/winspool/info.c
+44
-21
No files found.
dlls/winspool/info.c
View file @
facaee4f
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include "winbase.h"
#include "winbase.h"
#include "winerror.h"
#include "winerror.h"
#include "winreg.h"
#include "winreg.h"
#include "winternl.h"
#include "wine/windef16.h"
#include "wine/windef16.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -2435,23 +2436,23 @@ BOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment,
...
@@ -2435,23 +2436,23 @@ BOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment,
}
}
/*****************************************************************************
/*****************************************************************************
* GetPrinterDriverDirectory
A
[WINSPOOL.@]
* GetPrinterDriverDirectory
W
[WINSPOOL.@]
*/
*/
BOOL
WINAPI
GetPrinterDriverDirectory
A
(
LPSTR
pName
,
LP
STR
pEnvironment
,
BOOL
WINAPI
GetPrinterDriverDirectory
W
(
LPWSTR
pName
,
LPW
STR
pEnvironment
,
DWORD
Level
,
LPBYTE
pDriverDirectory
,
DWORD
Level
,
LPBYTE
pDriverDirectory
,
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
{
{
DWORD
needed
;
DWORD
needed
;
TRACE
(
"(%s, %s, %ld, %p, %ld, %p)
\n
"
,
pName
,
pEnvironment
,
Level
,
TRACE
(
"(%s, %s, %ld, %p, %ld, %p)
\n
"
,
debugstr_w
(
pName
),
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
debugstr_w
(
pEnvironment
),
Level
,
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
if
(
pName
!=
NULL
)
{
if
(
pName
!=
NULL
)
{
FIXME
(
"pName = `%s' - unsupported
\n
"
,
pName
);
FIXME
(
"pName = `%s' - unsupported
\n
"
,
debugstr_w
(
pName
)
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
return
FALSE
;
}
}
if
(
pEnvironment
!=
NULL
)
{
if
(
pEnvironment
!=
NULL
)
{
FIXME
(
"pEnvironment = `%s' - unsupported
\n
"
,
pEnvironment
);
FIXME
(
"pEnvironment = `%s' - unsupported
\n
"
,
debugstr_w
(
pEnvironment
)
);
SetLastError
(
ERROR_INVALID_ENVIRONMENT
);
SetLastError
(
ERROR_INVALID_ENVIRONMENT
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2459,10 +2460,16 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
...
@@ -2459,10 +2460,16 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
WARN
(
"Level = %ld - assuming 1
\n
"
,
Level
);
WARN
(
"Level = %ld - assuming 1
\n
"
,
Level
);
/* FIXME should read from registry */
/* FIXME should read from registry */
needed
=
GetSystemDirectoryA
(
pDriverDirectory
,
cbBuf
);
needed
=
GetSystemDirectoryW
(
(
LPWSTR
)
pDriverDirectory
,
cbBuf
/
sizeof
(
WCHAR
));
/* GetSystemDirectoryW returns number of TCHAR without '\0'
* adjust this now
*/
needed
++
;
needed
++
;
needed
*=
sizeof
(
WCHAR
);
if
(
pcbNeeded
)
if
(
pcbNeeded
)
*
pcbNeeded
=
needed
;
*
pcbNeeded
=
needed
;
TRACE
(
"required <%08lx>
\n
"
,
*
pcbNeeded
);
if
(
needed
>
cbBuf
)
{
if
(
needed
>
cbBuf
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
return
FALSE
;
...
@@ -2472,25 +2479,41 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
...
@@ -2472,25 +2479,41 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
/*****************************************************************************
/*****************************************************************************
* GetPrinterDriverDirectory
W
[WINSPOOL.@]
* GetPrinterDriverDirectory
A
[WINSPOOL.@]
*/
*/
BOOL
WINAPI
GetPrinterDriverDirectory
W
(
LPWSTR
pName
,
LPW
STR
pEnvironment
,
BOOL
WINAPI
GetPrinterDriverDirectory
A
(
LPSTR
pName
,
LP
STR
pEnvironment
,
DWORD
Level
,
LPBYTE
pDriverDirectory
,
DWORD
Level
,
LPBYTE
pDriverDirectory
,
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
{
{
LPSTR
pNameA
=
NULL
,
pEnvironmentA
=
NULL
;
UNICODE_STRING
nameW
,
environmentW
;
BOOL
ret
;
BOOL
ret
;
DWORD
pcbNeededW
;
if
(
pName
)
INT
len
=
cbBuf
*
sizeof
(
WCHAR
)
/
sizeof
(
CHAR
);
pNameA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pName
);
WCHAR
*
driverDirectoryW
=
NULL
;
if
(
pEnvironment
)
pEnvironmentA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pEnvironment
);
if
(
len
)
driverDirectoryW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
ret
=
GetPrinterDriverDirectoryA
(
pNameA
,
pEnvironmentA
,
Level
,
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
if
(
pName
)
RtlCreateUnicodeStringFromAsciiz
(
&
nameW
,
pName
);
if
(
pNameA
)
else
nameW
.
Buffer
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
pNameA
);
if
(
pEnvironment
)
RtlCreateUnicodeStringFromAsciiz
(
&
environmentW
,
pEnvironment
);
if
(
pEnvironmentA
)
else
environmentW
.
Buffer
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
pEnvironmentA
);
ret
=
GetPrinterDriverDirectoryW
(
nameW
.
Buffer
,
environmentW
.
Buffer
,
Level
,
(
LPBYTE
)
driverDirectoryW
,
len
,
&
pcbNeededW
);
if
(
ret
)
{
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
driverDirectoryW
,
-
1
,
pDriverDirectory
,
cbBuf
,
NULL
,
NULL
);
*
pcbNeeded
=
WideCharToMultiByte
(
CP_ACP
,
0
,
driverDirectoryW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
}
else
*
pcbNeeded
=
pcbNeededW
*
sizeof
(
CHAR
)
/
sizeof
(
WCHAR
);
TRACE
(
"provided<%ld> required <%ld>
\n
"
,
cbBuf
,
*
pcbNeeded
);
if
(
driverDirectoryW
)
HeapFree
(
GetProcessHeap
(),
0
,
driverDirectoryW
);
RtlFreeUnicodeString
(
&
environmentW
);
RtlFreeUnicodeString
(
&
nameW
);
return
ret
;
return
ret
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment