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
d2b850e8
Commit
d2b850e8
authored
Feb 12, 2001
by
Huw D M Davies
Committed by
Alexandre Julliard
Feb 12, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Set/GetPrinterData[Ex].
Remove ordinals from winspool.drv.spec .
parent
ae4f72f5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
206 additions
and
0 deletions
+206
-0
info.c
dlls/winspool/info.c
+190
-0
winspool.drv.spec
dlls/winspool/winspool.drv.spec
+0
-0
winspool.h
include/winspool.h
+16
-0
No files found.
dlls/winspool/info.c
View file @
d2b850e8
...
...
@@ -73,6 +73,8 @@ static WCHAR Print_ProcessorW[] = {'P','r','i','n','t',' ','P','r','o','c','e',
's'
,
's'
,
'o'
,
'r'
,
0
};
static
WCHAR
Printer_DriverW
[]
=
{
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
' '
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
static
WCHAR
PrinterDriverDataW
[]
=
{
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
WCHAR
Separator_FileW
[]
=
{
'S'
,
'e'
,
'p'
,
'a'
,
'r'
,
'a'
,
't'
,
'o'
,
'r'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
WCHAR
Share_NameW
[]
=
{
'S'
,
'h'
,
'a'
,
'r'
,
'e'
,
' '
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
...
...
@@ -151,6 +153,34 @@ static LPOPENEDPRINTER WINSPOOL_GetOpenedPrinter(int printerHandle)
return
pOpenedPrinter
;
}
/******************************************************************
* WINSPOOL_GetOpenedPrinterRegKey
*
*/
static
DWORD
WINSPOOL_GetOpenedPrinterRegKey
(
HANDLE
hPrinter
,
HKEY
*
phkey
)
{
LPOPENEDPRINTER
lpOpenedPrinter
=
WINSPOOL_GetOpenedPrinter
(
hPrinter
);
DWORD
ret
;
HKEY
hkeyPrinters
;
if
(
!
lpOpenedPrinter
)
return
ERROR_INVALID_HANDLE
;
if
((
ret
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
Printers
,
&
hkeyPrinters
))
!=
ERROR_SUCCESS
)
return
ret
;
if
(
RegOpenKeyW
(
hkeyPrinters
,
lpOpenedPrinter
->
lpsPrinterName
,
phkey
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't find opened printer %s in registry
\n
"
,
debugstr_w
(
lpOpenedPrinter
->
lpsPrinterName
));
RegCloseKey
(
hkeyPrinters
);
return
ERROR_INVALID_PRINTER_NAME
;
/* ? */
}
RegCloseKey
(
hkeyPrinters
);
return
ERROR_SUCCESS
;
}
/***********************************************************
* DEVMODEcpyAtoW
*/
...
...
@@ -2371,3 +2401,163 @@ BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE ports,DWORD bufsize,
FIXME
(
"(%s,%ld,%p,%ld,%p,%p), stub!
\n
"
,
name
,
level
,
ports
,
bufsize
,
bufneeded
,
bufreturned
);
return
FALSE
;
}
/******************************************************************************
* SetPrinterDataExA (WINSPOOL)
*/
DWORD
WINAPI
SetPrinterDataExA
(
HANDLE
hPrinter
,
LPSTR
pKeyName
,
LPSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
)
{
HKEY
hkeyPrinter
,
hkeySubkey
;
DWORD
ret
;
TRACE
(
"(%08x, %s, %s %08lx, %p, %08lx)
\n
"
,
hPrinter
,
debugstr_a
(
pKeyName
),
debugstr_a
(
pValueName
),
Type
,
pData
,
cbData
);
if
((
ret
=
WINSPOOL_GetOpenedPrinterRegKey
(
hPrinter
,
&
hkeyPrinter
))
!=
ERROR_SUCCESS
)
return
ret
;
if
((
ret
=
RegCreateKeyA
(
hkeyPrinter
,
pKeyName
,
&
hkeySubkey
))
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create subkey %s
\n
"
,
debugstr_a
(
pKeyName
));
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
ret
=
RegSetValueExA
(
hkeySubkey
,
pValueName
,
0
,
Type
,
pData
,
cbData
);
RegCloseKey
(
hkeySubkey
);
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
/******************************************************************************
* SetPrinterDataExW (WINSPOOL)
*/
DWORD
WINAPI
SetPrinterDataExW
(
HANDLE
hPrinter
,
LPWSTR
pKeyName
,
LPWSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
)
{
HKEY
hkeyPrinter
,
hkeySubkey
;
DWORD
ret
;
TRACE
(
"(%08x, %s, %s %08lx, %p, %08lx)
\n
"
,
hPrinter
,
debugstr_w
(
pKeyName
),
debugstr_w
(
pValueName
),
Type
,
pData
,
cbData
);
if
((
ret
=
WINSPOOL_GetOpenedPrinterRegKey
(
hPrinter
,
&
hkeyPrinter
))
!=
ERROR_SUCCESS
)
return
ret
;
if
((
ret
=
RegCreateKeyW
(
hkeyPrinter
,
pKeyName
,
&
hkeySubkey
))
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create subkey %s
\n
"
,
debugstr_w
(
pKeyName
));
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
ret
=
RegSetValueExW
(
hkeySubkey
,
pValueName
,
0
,
Type
,
pData
,
cbData
);
RegCloseKey
(
hkeySubkey
);
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
/******************************************************************************
* SetPrinterDataA (WINSPOOL)
*/
DWORD
WINAPI
SetPrinterDataA
(
HANDLE
hPrinter
,
LPSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
)
{
return
SetPrinterDataExA
(
hPrinter
,
"PrinterDriverData"
,
pValueName
,
Type
,
pData
,
cbData
);
}
/******************************************************************************
* SetPrinterDataW (WINSPOOL)
*/
DWORD
WINAPI
SetPrinterDataW
(
HANDLE
hPrinter
,
LPWSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
)
{
return
SetPrinterDataExW
(
hPrinter
,
PrinterDriverDataW
,
pValueName
,
Type
,
pData
,
cbData
);
}
/******************************************************************************
* GetPrinterDataExA (WINSPOOL)
*/
DWORD
WINAPI
GetPrinterDataExA
(
HANDLE
hPrinter
,
LPSTR
pKeyName
,
LPSTR
pValueName
,
LPDWORD
pType
,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
)
{
HKEY
hkeyPrinter
,
hkeySubkey
;
DWORD
ret
;
TRACE
(
"(%08x, %s, %s %p, %p, %08lx, %p)
\n
"
,
hPrinter
,
debugstr_a
(
pKeyName
),
debugstr_a
(
pValueName
),
pType
,
pData
,
nSize
,
pcbNeeded
);
if
((
ret
=
WINSPOOL_GetOpenedPrinterRegKey
(
hPrinter
,
&
hkeyPrinter
))
!=
ERROR_SUCCESS
)
return
ret
;
if
((
ret
=
RegOpenKeyA
(
hkeyPrinter
,
pKeyName
,
&
hkeySubkey
))
!=
ERROR_SUCCESS
)
{
WARN
(
"Can't open subkey %s
\n
"
,
debugstr_a
(
pKeyName
));
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
*
pcbNeeded
=
nSize
;
ret
=
RegQueryValueExA
(
hkeySubkey
,
pValueName
,
0
,
pType
,
pData
,
pcbNeeded
);
RegCloseKey
(
hkeySubkey
);
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
/******************************************************************************
* GetPrinterDataExW (WINSPOOL)
*/
DWORD
WINAPI
GetPrinterDataExW
(
HANDLE
hPrinter
,
LPWSTR
pKeyName
,
LPWSTR
pValueName
,
LPDWORD
pType
,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
)
{
HKEY
hkeyPrinter
,
hkeySubkey
;
DWORD
ret
;
TRACE
(
"(%08x, %s, %s %p, %p, %08lx, %p)
\n
"
,
hPrinter
,
debugstr_w
(
pKeyName
),
debugstr_w
(
pValueName
),
pType
,
pData
,
nSize
,
pcbNeeded
);
if
((
ret
=
WINSPOOL_GetOpenedPrinterRegKey
(
hPrinter
,
&
hkeyPrinter
))
!=
ERROR_SUCCESS
)
return
ret
;
if
((
ret
=
RegOpenKeyW
(
hkeyPrinter
,
pKeyName
,
&
hkeySubkey
))
!=
ERROR_SUCCESS
)
{
WARN
(
"Can't open subkey %s
\n
"
,
debugstr_w
(
pKeyName
));
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
*
pcbNeeded
=
nSize
;
ret
=
RegQueryValueExW
(
hkeySubkey
,
pValueName
,
0
,
pType
,
pData
,
pcbNeeded
);
RegCloseKey
(
hkeySubkey
);
RegCloseKey
(
hkeyPrinter
);
return
ret
;
}
/******************************************************************************
* GetPrinterDataA (WINSPOOL)
*/
DWORD
WINAPI
GetPrinterDataA
(
HANDLE
hPrinter
,
LPSTR
pValueName
,
LPDWORD
pType
,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
)
{
return
GetPrinterDataExA
(
hPrinter
,
"PrinterDriverData"
,
pValueName
,
pType
,
pData
,
nSize
,
pcbNeeded
);
}
/******************************************************************************
* GetPrinterDataW (WINSPOOL)
*/
DWORD
WINAPI
GetPrinterDataW
(
HANDLE
hPrinter
,
LPWSTR
pValueName
,
LPDWORD
pType
,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
)
{
return
GetPrinterDataExW
(
hPrinter
,
PrinterDriverDataW
,
pValueName
,
pType
,
pData
,
nSize
,
pcbNeeded
);
}
dlls/winspool/winspool.drv.spec
View file @
d2b850e8
This diff is collapsed.
Click to expand it.
include/winspool.h
View file @
d2b850e8
...
...
@@ -957,12 +957,28 @@ DWORD WINAPI GetPrinterDataW(HANDLE hPrinter, LPWSTR pValueName, LPDWORD pType,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
);
#define GetPrinterData WINELIB_NAME_AW(GetPrinterData)
DWORD
WINAPI
GetPrinterDataExA
(
HANDLE
hPrinter
,
LPSTR
pKeyName
,
LPSTR
pValueName
,
LPDWORD
pType
,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
);
DWORD
WINAPI
GetPrinterDataExW
(
HANDLE
hPrinter
,
LPWSTR
pKeyName
,
LPWSTR
pValueName
,
LPDWORD
pType
,
LPBYTE
pData
,
DWORD
nSize
,
LPDWORD
pcbNeeded
);
#define GetPrinterDataEx WINELIB_NAME_AW(GetPrinterDataEx)
DWORD
WINAPI
SetPrinterDataA
(
HANDLE
hPrinter
,
LPSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
);
DWORD
WINAPI
SetPrinterDataW
(
HANDLE
hPrinter
,
LPWSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
);
#define SetPrinterData WINELIB_NAME_AW(SetPrinterData)
DWORD
WINAPI
SetPrinterDataExA
(
HANDLE
hPrinter
,
LPSTR
pKeyName
,
LPSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
);
DWORD
WINAPI
SetPrinterDataExW
(
HANDLE
hPrinter
,
LPWSTR
pKeyName
,
LPWSTR
pValueName
,
DWORD
Type
,
LPBYTE
pData
,
DWORD
cbData
);
#define SetPrinterDataEx WINELIB_NAME_AW(SetPrinterDataEx)
DWORD
WINAPI
WaitForPrinterChange
(
HANDLE
hPrinter
,
DWORD
Flags
);
HANDLE
WINAPI
FindFirstPrinterChangeNotification
(
HANDLE
hPrinter
,
DWORD
fdwFlags
,
...
...
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