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
a0324f71
Commit
a0324f71
authored
Jan 22, 2002
by
Mark G. Adams
Committed by
Alexandre Julliard
Jan 22, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GetDefaultPrinter() functions.
parent
7aa67c1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
0 deletions
+71
-0
info.c
dlls/winspool/info.c
+65
-0
winspool.drv.spec
dlls/winspool/winspool.drv.spec
+2
-0
winspool.h
include/winspool.h
+4
-0
No files found.
dlls/winspool/info.c
View file @
a0324f71
...
...
@@ -2687,6 +2687,71 @@ BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE ports,DWORD bufsize,
}
/******************************************************************************
* GetDefaultPrinterA (WINSPOOL.@)
*
* Based on PRINTDLG_GetDefaultPrinterName in dlls/commdlg/printdlg.c
*/
BOOL
WINAPI
GetDefaultPrinterA
(
LPSTR
name
,
LPDWORD
namesize
)
{
char
*
ptr
;
if
(
*
namesize
<
1
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
if
(
!
GetProfileStringA
(
"windows"
,
"device"
,
""
,
name
,
*
namesize
))
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
if
((
ptr
=
strchr
(
name
,
','
))
==
NULL
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
*
ptr
=
'\0'
;
*
namesize
=
strlen
(
name
)
+
1
;
return
TRUE
;
}
/******************************************************************************
* GetDefaultPrinterW (WINSPOOL.@)
*/
BOOL
WINAPI
GetDefaultPrinterW
(
LPWSTR
name
,
LPDWORD
namesize
)
{
char
*
buf
;
BOOL
ret
;
if
(
*
namesize
<
1
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
namesize
);
ret
=
GetDefaultPrinterA
(
buf
,
namesize
);
if
(
ret
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
buf
,
-
1
,
name
,
*
namesize
);
if
(
!
len
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
FALSE
;
}
else
*
namesize
=
len
;
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
ret
;
}
/******************************************************************************
* SetPrinterDataExA (WINSPOOL.@)
*/
DWORD
WINAPI
SetPrinterDataExA
(
HANDLE
hPrinter
,
LPSTR
pKeyName
,
...
...
dlls/winspool/winspool.drv.spec
View file @
a0324f71
...
...
@@ -94,6 +94,8 @@ debug_channels (winspool)
@ stub FindFirstPrinterChangeNotification
@ stub FindNextPrinterChangeNotification
@ stub FreePrinterNotifyInfo
@ stdcall GetDefaultPrinterA(str ptr) GetDefaultPrinterA
@ stdcall GetDefaultPrinterW(wstr ptr) GetDefaultPrinterW
@ stdcall GetFormA(long str long ptr long ptr) GetFormA
@ stdcall GetFormW(long wstr long ptr long ptr) GetFormW
@ stub GetJobA
...
...
include/winspool.h
View file @
a0324f71
...
...
@@ -888,6 +888,10 @@ BOOL WINAPI EnumPrinterDriversW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level,
LPDWORD
pcbNeeded
,
LPDWORD
pcbReturned
);
#define EnumPrinterDrivers WINELIB_NAME_AW(EnumPrinterDrivers)
BOOL
WINAPI
GetDefaultPrinterA
(
LPSTR
pName
,
LPDWORD
pcbNameSize
);
BOOL
WINAPI
GetDefaultPrinterW
(
LPWSTR
pName
,
LPDWORD
pcbNameSize
);
#define GetDefaultPrinter WINELIB_NAME_AW(GetDefaultPrinter)
BOOL
WINAPI
DeletePrinterDriverA
(
LPSTR
pName
,
LPSTR
pEnvironment
,
LPSTR
pDriverName
);
BOOL
WINAPI
DeletePrinterDriverW
(
LPWSTR
pName
,
LPWSTR
pEnvironment
,
...
...
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