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
3b77de9c
Commit
3b77de9c
authored
Jul 22, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Jul 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement the undocumented StartDocDlg[A|W]. These will be used by
StartDoc.
parent
88837b5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
6 deletions
+114
-6
info.c
dlls/winspool/info.c
+108
-4
winspool.drv.spec
dlls/winspool/winspool.drv.spec
+2
-2
winspool.h
include/winspool.h
+4
-0
No files found.
dlls/winspool/info.c
View file @
3b77de9c
...
@@ -5153,12 +5153,12 @@ INT_PTR CALLBACK file_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
...
@@ -5153,12 +5153,12 @@ INT_PTR CALLBACK file_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
if
(
LOWORD
(
wparam
)
==
IDOK
)
if
(
LOWORD
(
wparam
)
==
IDOK
)
{
{
HANDLE
hf
;
HANDLE
hf
;
DWORD
len
=
SendDlgItemMessageW
(
hwnd
,
201
,
WM_GETTEXTLENGTH
,
0
,
0
);
DWORD
len
=
SendDlgItemMessageW
(
hwnd
,
EDITBOX
,
WM_GETTEXTLENGTH
,
0
,
0
);
LPWSTR
*
output
;
LPWSTR
*
output
;
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
GetDlgItemTextW
(
hwnd
,
EDITBOX
,
filename
,
len
+
1
);
GetDlgItemTextW
(
hwnd
,
EDITBOX
,
filename
,
len
+
1
);
if
(
GetFileAttributesW
(
filename
)
!=
INVALID_FILE_ATTRIBUTES
)
if
(
GetFileAttributesW
(
filename
)
!=
INVALID_FILE_ATTRIBUTES
)
{
{
WCHAR
caption
[
200
],
message
[
200
];
WCHAR
caption
[
200
],
message
[
200
];
...
@@ -5203,14 +5203,22 @@ INT_PTR CALLBACK file_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
...
@@ -5203,14 +5203,22 @@ INT_PTR CALLBACK file_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
}
}
/*****************************************************************************
/*****************************************************************************
* get_filename
*/
static
BOOL
get_filename
(
LPWSTR
*
filename
)
{
return
DialogBoxParamW
(
WINSPOOL_hInstance
,
MAKEINTRESOURCEW
(
FILENAME_DIALOG
),
GetForegroundWindow
(),
file_dlg_proc
,
(
LPARAM
)
filename
)
==
IDOK
;
}
/*****************************************************************************
* schedule_file
* schedule_file
*/
*/
static
BOOL
schedule_file
(
LPCWSTR
filename
)
static
BOOL
schedule_file
(
LPCWSTR
filename
)
{
{
LPWSTR
output
=
NULL
;
LPWSTR
output
=
NULL
;
if
(
DialogBoxParamW
(
WINSPOOL_hInstance
,
MAKEINTRESOURCEW
(
FILENAME_DIALOG
),
GetForegroundWindow
(),
if
(
get_filename
(
&
output
))
file_dlg_proc
,
(
LPARAM
)
&
output
)
==
IDOK
)
{
{
TRACE
(
"copy to %s
\n
"
,
debugstr_w
(
output
));
TRACE
(
"copy to %s
\n
"
,
debugstr_w
(
output
));
CopyFileW
(
filename
,
output
,
FALSE
);
CopyFileW
(
filename
,
output
,
FALSE
);
...
@@ -5404,3 +5412,99 @@ end:
...
@@ -5404,3 +5412,99 @@ end:
LeaveCriticalSection
(
&
printer_handles_cs
);
LeaveCriticalSection
(
&
printer_handles_cs
);
return
ret
;
return
ret
;
}
}
/*****************************************************************************
* StartDocDlgA [WINSPOOL.@]
*/
LPSTR
WINAPI
StartDocDlgA
(
HANDLE
hPrinter
,
DOCINFOA
*
doc
)
{
UNICODE_STRING
usBuffer
;
DOCINFOW
docW
;
LPWSTR
retW
;
LPSTR
ret
=
NULL
;
docW
.
cbSize
=
sizeof
(
docW
);
docW
.
lpszDocName
=
asciitounicode
(
&
usBuffer
,
doc
->
lpszDocName
);
docW
.
lpszOutput
=
asciitounicode
(
&
usBuffer
,
doc
->
lpszOutput
);
docW
.
lpszDatatype
=
asciitounicode
(
&
usBuffer
,
doc
->
lpszDatatype
);
docW
.
fwType
=
doc
->
fwType
;
retW
=
StartDocDlgW
(
hPrinter
,
&
docW
);
if
(
retW
)
{
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
retW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
retW
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
retW
);
}
HeapFree
(
GetProcessHeap
(),
0
,
(
LPWSTR
)
docW
.
lpszDatatype
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPWSTR
)
docW
.
lpszOutput
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPWSTR
)
docW
.
lpszDocName
);
return
ret
;
}
/*****************************************************************************
* StartDocDlgW [WINSPOOL.@]
*
* Undocumented: Apparently used by gdi32:StartDocW() to popup the file dialog
* when lpszOutput is "FILE:" or if lpszOutput is NULL and the default printer
* port is "FILE:". Also returns the full path if passed a relative path.
*
* The caller should free the returned string from the process heap.
*/
LPWSTR
WINAPI
StartDocDlgW
(
HANDLE
hPrinter
,
DOCINFOW
*
doc
)
{
LPWSTR
ret
=
NULL
;
DWORD
len
,
attr
;
if
(
doc
->
lpszOutput
==
NULL
)
/* Check whether default port is FILE: */
{
PRINTER_INFO_5W
*
pi5
;
GetPrinterW
(
hPrinter
,
5
,
NULL
,
0
,
&
len
);
if
(
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
return
NULL
;
pi5
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
GetPrinterW
(
hPrinter
,
5
,
(
LPBYTE
)
pi5
,
len
,
&
len
);
if
(
!
pi5
->
pPortName
||
strcmpW
(
pi5
->
pPortName
,
FILE_Port
))
{
HeapFree
(
GetProcessHeap
(),
0
,
pi5
);
return
NULL
;
}
HeapFree
(
GetProcessHeap
(),
0
,
pi5
);
}
if
(
doc
->
lpszOutput
==
NULL
||
!
strcmpW
(
doc
->
lpszOutput
,
FILE_Port
))
{
LPWSTR
name
;
get_filename
(
&
name
);
if
(
name
)
{
if
(
!
(
len
=
GetFullPathNameW
(
name
,
0
,
NULL
,
NULL
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
name
);
return
NULL
;
}
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
GetFullPathNameW
(
name
,
len
,
ret
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
return
ret
;
}
if
(
!
(
len
=
GetFullPathNameW
(
doc
->
lpszOutput
,
0
,
NULL
,
NULL
)))
return
NULL
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
GetFullPathNameW
(
doc
->
lpszOutput
,
len
,
ret
,
NULL
);
attr
=
GetFileAttributesW
(
ret
);
if
(
attr
!=
INVALID_FILE_ATTRIBUTES
&&
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
))
{
HeapFree
(
GetProcessHeap
(),
0
,
ret
);
ret
=
NULL
;
}
return
ret
;
}
dlls/winspool/winspool.drv.spec
View file @
3b77de9c
...
@@ -130,8 +130,8 @@
...
@@ -130,8 +130,8 @@
@ stdcall SetPrinterW(long long ptr long)
@ stdcall SetPrinterW(long long ptr long)
@ stub SpoolerDevQueryPrintW
@ stub SpoolerDevQueryPrintW
@ stub SpoolerInit
@ stub SpoolerInit
@ st
ub StartDocDlgA
@ st
dcall StartDocDlgA(ptr ptr)
@ st
ub StartDocDlgW
@ st
dcall StartDocDlgW(ptr ptr)
@ stdcall StartDocPrinterA(long long ptr)
@ stdcall StartDocPrinterA(long long ptr)
@ stdcall StartDocPrinterW(long long ptr)
@ stdcall StartDocPrinterW(long long ptr)
@ stdcall StartPagePrinter(long)
@ stdcall StartPagePrinter(long)
...
...
include/winspool.h
View file @
3b77de9c
...
@@ -1160,6 +1160,10 @@ LONG WINAPI ExtDeviceMode( HWND hWnd, HANDLE hInst, LPDEVMODEA pDevModeOutput,
...
@@ -1160,6 +1160,10 @@ LONG WINAPI ExtDeviceMode( HWND hWnd, HANDLE hInst, LPDEVMODEA pDevModeOutput,
LPSTR
pDeviceName
,
LPSTR
pPort
,
LPDEVMODEA
pDevModeInput
,
LPSTR
pProfile
,
LPSTR
pDeviceName
,
LPSTR
pPort
,
LPDEVMODEA
pDevModeInput
,
LPSTR
pProfile
,
DWORD
fMode
);
DWORD
fMode
);
LPSTR
WINAPI
StartDocDlgA
(
HANDLE
hPrinter
,
DOCINFOA
*
doc
);
LPWSTR
WINAPI
StartDocDlgW
(
HANDLE
hPrinter
,
DOCINFOW
*
doc
);
#define StartDocDlg WINELIB_NAME_AW(StartDocDlg)
#ifdef __cplusplus
#ifdef __cplusplus
}
/* extern "C" */
}
/* extern "C" */
#endif
#endif
...
...
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