Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d4193bbd
Commit
d4193bbd
authored
Mar 29, 2005
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Mar 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unicodify WINSPOOL_OpenDriverReg().
parent
e42a23d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
22 deletions
+34
-22
info.c
dlls/winspool/info.c
+34
-22
No files found.
dlls/winspool/info.c
View file @
d4193bbd
...
...
@@ -70,8 +70,13 @@ static INT (WINAPI *GDI_CallExtDeviceMode16)( HWND hwnd, LPDEVMODEA lpdmOutput,
static
const
char
Printers
[]
=
"System
\\
CurrentControlSet
\\
control
\\
Print
\\
Printers
\\
"
;
static
const
char
Drivers
[]
=
"System
\\
CurrentControlSet
\\
control
\\
Print
\\
Environments
\\
%s
\\
Drivers
\\
"
;
static
const
WCHAR
DriversW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'c'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'\\'
,
'E'
,
'n'
,
'v'
,
'i'
,
'r'
,
'o'
,
'n'
,
'm'
,
'e'
,
'n'
,
't'
,
's'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
DefaultEnvironmentW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
0
};
...
...
@@ -1155,49 +1160,56 @@ BOOL WINAPI GetPrintProcessorDirectoryW(LPWSTR server, LPWSTR env,
* NULL on error
*/
static
HKEY
WINSPOOL_OpenDriverReg
(
LPVOID
pEnvironment
,
BOOL
unicode
)
{
HKEY
retval
;
LPSTR
lpKey
,
p
=
NULL
;
{
static
const
WCHAR
WinNTW
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
' '
,
'x'
,
'8'
,
'6'
,
0
};
static
const
WCHAR
Win40W
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'4'
,
'.'
,
'0'
,
0
};
HKEY
retval
;
LPWSTR
lpKey
,
buffer
=
NULL
;
LPCWSTR
pEnvW
;
TRACE
(
"%s
\n
"
,
(
unicode
)
?
debugstr_w
(
pEnvironment
)
:
debugstr_a
(
pEnvironment
));
if
(
pEnvironment
)
p
=
(
unicode
)
?
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pEnvironment
)
:
pEnvironment
;
else
{
OSVERSIONINFOA
ver
;
ver
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
);
if
(
pEnvironment
)
{
if
(
unicode
)
{
pEnvW
=
pEnvironment
;
}
else
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
pEnvironment
,
-
1
,
NULL
,
0
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
buffer
)
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
pEnvironment
,
-
1
,
buffer
,
len
);
pEnvW
=
buffer
;
}
}
else
{
OSVERSIONINFOW
ver
;
ver
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOW
);
if
(
!
GetVersionEx
A
(
&
ver
))
if
(
!
GetVersionEx
W
(
&
ver
))
return
0
;
switch
(
ver
.
dwPlatformId
)
{
case
VER_PLATFORM_WIN32s
:
ERR
(
"win32 style printing used with 16 bits app, try specifying 'win95' Windows version
\n
"
);
return
0
;
case
VER_PLATFORM_WIN32_NT
:
p
=
"Windows NT x86"
;
p
EnvW
=
WinNTW
;
break
;
default:
p
=
"Windows 4.0"
;
p
EnvW
=
Win40W
;
break
;
}
TRACE
(
"set environment to %s
\n
"
,
p
);
TRACE
(
"set environment to %s
\n
"
,
debugstr_w
(
pEnvW
)
);
}
lpKey
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
strlen
(
p
)
+
strlen
(
Drivers
));
sprintf
(
lpKey
,
Drivers
,
p
);
(
strlenW
(
pEnvW
)
+
strlenW
(
DriversW
)
+
1
)
*
sizeof
(
WCHAR
));
wsprintfW
(
lpKey
,
DriversW
,
pEnvW
);
TRACE
(
"%s
\n
"
,
lpKey
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
lpKey
)
);
if
(
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
lpKey
,
&
retval
)
!=
ERROR_SUCCESS
)
if
(
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
lpKey
,
&
retval
)
!=
ERROR_SUCCESS
)
retval
=
0
;
if
(
pEnvironment
&&
unicode
)
HeapFree
(
GetProcessHeap
(),
0
,
p
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
lpKey
);
return
retval
;
...
...
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