Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
facaee4f
Commit
facaee4f
authored
22 years ago
by
Stefan Leichter
Committed by
Alexandre Julliard
22 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Moved implementation of GetPrinterDriverDirectory from ascii to unicode.
parent
fa93b446
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winspool/info.c
+44
-21
44 additions, 21 deletions
dlls/winspool/info.c
with
44 additions
and
21 deletions
dlls/winspool/info.c
+
44
−
21
View file @
facaee4f
...
...
@@ -41,6 +41,7 @@
#include
"winbase.h"
#include
"winerror.h"
#include
"winreg.h"
#include
"winternl.h"
#include
"wine/windef16.h"
#include
"wine/unicode.h"
#include
"wine/debug.h"
...
...
@@ -2435,23 +2436,23 @@ BOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment,
}
/*****************************************************************************
* GetPrinterDriverDirectory
A
[WINSPOOL.@]
* GetPrinterDriverDirectory
W
[WINSPOOL.@]
*/
BOOL
WINAPI
GetPrinterDriverDirectory
A
(
LPSTR
pName
,
LPSTR
pEnvironment
,
BOOL
WINAPI
GetPrinterDriverDirectory
W
(
LP
W
STR
pName
,
LP
W
STR
pEnvironment
,
DWORD
Level
,
LPBYTE
pDriverDirectory
,
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
{
DWORD
needed
;
TRACE
(
"(%s, %s, %ld, %p, %ld, %p)
\n
"
,
pName
,
pEnvironment
,
Level
,
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
TRACE
(
"(%s, %s, %ld, %p, %ld, %p)
\n
"
,
debugstr_w
(
pName
),
debugstr_w
(
pEnvironment
),
Level
,
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
if
(
pName
!=
NULL
)
{
FIXME
(
"pName = `%s' - unsupported
\n
"
,
pName
);
FIXME
(
"pName = `%s' - unsupported
\n
"
,
debugstr_w
(
pName
)
)
;
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
pEnvironment
!=
NULL
)
{
FIXME
(
"pEnvironment = `%s' - unsupported
\n
"
,
pEnvironment
);
FIXME
(
"pEnvironment = `%s' - unsupported
\n
"
,
debugstr_w
(
pEnvironment
)
)
;
SetLastError
(
ERROR_INVALID_ENVIRONMENT
);
return
FALSE
;
}
...
...
@@ -2459,10 +2460,16 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
WARN
(
"Level = %ld - assuming 1
\n
"
,
Level
);
/* 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
*=
sizeof
(
WCHAR
);
if
(
pcbNeeded
)
*
pcbNeeded
=
needed
;
TRACE
(
"required <%08lx>
\n
"
,
*
pcbNeeded
);
if
(
needed
>
cbBuf
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
...
...
@@ -2472,25 +2479,41 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
/*****************************************************************************
* GetPrinterDriverDirectory
W
[WINSPOOL.@]
* GetPrinterDriverDirectory
A
[WINSPOOL.@]
*/
BOOL
WINAPI
GetPrinterDriverDirectory
W
(
LP
W
STR
pName
,
LP
W
STR
pEnvironment
,
BOOL
WINAPI
GetPrinterDriverDirectory
A
(
LPSTR
pName
,
LPSTR
pEnvironment
,
DWORD
Level
,
LPBYTE
pDriverDirectory
,
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
{
LPSTR
pNameA
=
NULL
,
pE
nvironment
A
=
NULL
;
UNICODE_STRING
nameW
,
e
nvironment
W
;
BOOL
ret
;
if
(
pName
)
pNameA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pName
);
if
(
pEnvironment
)
pEnvironmentA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pEnvironment
);
ret
=
GetPrinterDriverDirectoryA
(
pNameA
,
pEnvironmentA
,
Level
,
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
if
(
pNameA
)
HeapFree
(
GetProcessHeap
(),
0
,
pNameA
);
if
(
pEnvironmentA
)
HeapFree
(
GetProcessHeap
(),
0
,
pEnvironmentA
);
DWORD
pcbNeededW
;
INT
len
=
cbBuf
*
sizeof
(
WCHAR
)
/
sizeof
(
CHAR
);
WCHAR
*
driverDirectoryW
=
NULL
;
if
(
len
)
driverDirectoryW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
pName
)
RtlCreateUnicodeStringFromAsciiz
(
&
nameW
,
pName
);
else
nameW
.
Buffer
=
NULL
;
if
(
pEnvironment
)
RtlCreateUnicodeStringFromAsciiz
(
&
environmentW
,
pEnvironment
);
else
environmentW
.
Buffer
=
NULL
;
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment