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
b97c5da2
Commit
b97c5da2
authored
May 31, 2012
by
Huw Davies
Committed by
Alexandre Julliard
May 31, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Change get_dword_from_reg to accept a unicode value name.
parent
e550cee7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
info.c
dlls/winspool.drv/info.c
+19
-21
No files found.
dlls/winspool.drv/info.c
View file @
b97c5da2
...
...
@@ -195,6 +195,7 @@ static const WCHAR Default_DevModeW[] = {'D','e','f','a','u','l','t',' ','D','e'
static
const
WCHAR
Default_PriorityW
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
' '
,
'P'
,
'r'
,
'i'
,
'o'
,
'r'
,
'i'
,
't'
,
'y'
,
0
};
static
const
WCHAR
Dependent_FilesW
[]
=
{
'D'
,
'e'
,
'p'
,
'e'
,
'n'
,
'd'
,
'e'
,
'n'
,
't'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
static
const
WCHAR
DescriptionW
[]
=
{
'D'
,
'e'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
dnsTimeoutW
[]
=
{
'd'
,
'n'
,
's'
,
'T'
,
'i'
,
'm'
,
'e'
,
'o'
,
'u'
,
't'
,
0
};
static
const
WCHAR
DriverW
[]
=
{
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
HardwareIDW
[]
=
{
'H'
,
'a'
,
'r'
,
'd'
,
'w'
,
'a'
,
'r'
,
'e'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
Help_FileW
[]
=
{
'H'
,
'e'
,
'l'
,
'p'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
...
...
@@ -218,6 +219,7 @@ static const WCHAR Separator_FileW[] = {'S','e','p','a','r','a','t','o','r',' ',
static
const
WCHAR
Share_NameW
[]
=
{
'S'
,
'h'
,
'a'
,
'r'
,
'e'
,
' '
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
StartTimeW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'T'
,
'i'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
StatusW
[]
=
{
'S'
,
't'
,
'a'
,
't'
,
'u'
,
's'
,
0
};
static
const
WCHAR
txTimeoutW
[]
=
{
't'
,
'x'
,
'T'
,
'i'
,
'm'
,
'e'
,
'o'
,
'u'
,
't'
,
0
};
static
const
WCHAR
UntilTimeW
[]
=
{
'U'
,
'n'
,
't'
,
'i'
,
'l'
,
'T'
,
'i'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
VersionW
[]
=
{
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
WCHAR
WinPrintW
[]
=
{
'W'
,
'i'
,
'n'
,
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
0
};
...
...
@@ -3358,29 +3360,28 @@ BOOL WINAPI ResetPrinterW(HANDLE hPrinter, LPPRINTER_DEFAULTSW pDefault)
}
/*****************************************************************************
*
WINSPOOL_GetDWORDFromR
eg
*
get_dword_from_r
eg
*
* Return DWORD associated with
ValueN
ame from hkey.
* Return DWORD associated with
n
ame from hkey.
*/
static
DWORD
WINSPOOL_GetDWORDFromReg
(
HKEY
hkey
,
LPCSTR
ValueName
)
static
DWORD
get_dword_from_reg
(
HKEY
hkey
,
const
WCHAR
*
name
)
{
DWORD
sz
=
sizeof
(
DWORD
),
type
,
value
=
0
;
LONG
ret
;
ret
=
RegQueryValueEx
A
(
hkey
,
ValueName
,
0
,
&
type
,
(
LPBYTE
)
&
value
,
&
sz
);
ret
=
RegQueryValueEx
W
(
hkey
,
name
,
0
,
&
type
,
(
LPBYTE
)
&
value
,
&
sz
);
if
(
ret
!=
ERROR_SUCCESS
)
{
WARN
(
"Got ret = %d on name %s
\n
"
,
ret
,
ValueName
);
return
0
;
WARN
(
"Got ret = %d on name %s
\n
"
,
ret
,
debugstr_w
(
name
)
);
return
0
;
}
if
(
type
!=
REG_DWORD
)
{
ERR
(
"Got type %d
\n
"
,
type
);
return
0
;
return
0
;
}
return
value
;
}
/*****************************************************************************
* get_filename_from_reg [internal]
*
...
...
@@ -3770,12 +3771,11 @@ static BOOL WINSPOOL_GetPrinter_2(HKEY hkeyPrinter, PRINTER_INFO_2W *pi2,
*
pcbNeeded
+=
size
;
}
if
(
pi2
)
{
pi2
->
Attributes
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"Attributes"
);
pi2
->
Priority
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"Priority"
);
pi2
->
DefaultPriority
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"Default Priority"
);
pi2
->
StartTime
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"StartTime"
);
pi2
->
UntilTime
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"UntilTime"
);
pi2
->
Attributes
=
get_dword_from_reg
(
hkeyPrinter
,
AttributesW
);
pi2
->
Priority
=
get_dword_from_reg
(
hkeyPrinter
,
PriorityW
);
pi2
->
DefaultPriority
=
get_dword_from_reg
(
hkeyPrinter
,
Default_PriorityW
);
pi2
->
StartTime
=
get_dword_from_reg
(
hkeyPrinter
,
StartTimeW
);
pi2
->
UntilTime
=
get_dword_from_reg
(
hkeyPrinter
,
UntilTimeW
);
}
if
(
!
space
&&
pi2
)
/* zero out pi2 if we can't completely fill buf */
...
...
@@ -3808,7 +3808,7 @@ static BOOL WINSPOOL_GetPrinter_4(HKEY hkeyPrinter, PRINTER_INFO_4W *pi4,
*
pcbNeeded
+=
size
;
}
if
(
pi4
)
{
pi4
->
Attributes
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"Attributes"
);
pi4
->
Attributes
=
get_dword_from_reg
(
hkeyPrinter
,
AttributesW
);
}
if
(
!
space
&&
pi4
)
/* zero out pi4 if we can't completely fill buf */
...
...
@@ -3850,11 +3850,9 @@ static BOOL WINSPOOL_GetPrinter_5(HKEY hkeyPrinter, PRINTER_INFO_5W *pi5,
*
pcbNeeded
+=
size
;
}
if
(
pi5
)
{
pi5
->
Attributes
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"Attributes"
);
pi5
->
DeviceNotSelectedTimeout
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"dnsTimeout"
);
pi5
->
TransmissionRetryTimeout
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"txTimeout"
);
pi5
->
Attributes
=
get_dword_from_reg
(
hkeyPrinter
,
AttributesW
);
pi5
->
DeviceNotSelectedTimeout
=
get_dword_from_reg
(
hkeyPrinter
,
dnsTimeoutW
);
pi5
->
TransmissionRetryTimeout
=
get_dword_from_reg
(
hkeyPrinter
,
txTimeoutW
);
}
if
(
!
space
&&
pi5
)
/* zero out pi5 if we can't completely fill buf */
...
...
@@ -4021,7 +4019,7 @@ BOOL WINAPI GetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter,
size
=
sizeof
(
PRINTER_INFO_6
);
if
(
size
<=
cbBuf
)
{
/* FIXME: We do not update the status yet */
pi6
->
dwStatus
=
WINSPOOL_GetDWORDFromReg
(
hkeyPrinter
,
"Status"
);
pi6
->
dwStatus
=
get_dword_from_reg
(
hkeyPrinter
,
StatusW
);
ret
=
TRUE
;
}
else
{
ret
=
FALSE
;
...
...
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