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
e502d4dd
Commit
e502d4dd
authored
Jul 12, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Jul 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ScheduleJob for 'file' ports.
parent
8f83234a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
190 additions
and
3 deletions
+190
-3
.cvsignore
dlls/winspool/.cvsignore
+1
-0
En.rc
dlls/winspool/En.rc
+39
-0
Makefile.in
dlls/winspool/Makefile.in
+2
-0
info.c
dlls/winspool/info.c
+88
-0
winspool.rc
dlls/winspool/winspool.rc
+26
-0
wspool.c
dlls/winspool/wspool.c
+3
-3
wspool.h
dlls/winspool/wspool.h
+31
-0
No files found.
dlls/winspool/.cvsignore
View file @
e502d4dd
Makefile
libwinspool.drv.def
winspool.drv.dbg.c
winspool.res
dlls/winspool/En.rc
0 → 100644
View file @
e502d4dd
/*
* English resources for winspool
*
* Copyright 2005 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
FILENAME_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47
STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION
CAPTION "Print to File"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Output File Name:", -1, 7, 13, 194, 13, WS_VISIBLE
EDITTEXT EDITBOX, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL
DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE
PUSHBUTTON "Cancel", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE
END
STRINGTABLE DISCARDABLE
{
IDS_CAPTION "Local Port"
IDS_FILE_EXISTS "The output file already exists. Click OK to overwrite."
IDS_CANNOT_OPEN "Unable to create the output file."
}
dlls/winspool/Makefile.in
View file @
e502d4dd
...
...
@@ -12,6 +12,8 @@ C_SRCS = \
info.c
\
wspool.c
RC_SRCS
=
winspool.rc
SUBDIRS
=
tests
@MAKE_DLL_RULES@
...
...
dlls/winspool/info.c
View file @
e502d4dd
...
...
@@ -56,6 +56,8 @@
#include "heap.h"
#include "winnls.h"
#include "wspool.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winspool
);
static
CRITICAL_SECTION
printer_handles_cs
;
...
...
@@ -4772,6 +4774,88 @@ static BOOL schedule_cups(LPCWSTR printer_name, LPCWSTR filename)
}
}
INT_PTR
CALLBACK
file_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
LPWSTR
filename
;
switch
(
msg
)
{
case
WM_INITDIALOG
:
SetWindowLongPtrW
(
hwnd
,
DWLP_USER
,
lparam
);
return
TRUE
;
case
WM_COMMAND
:
if
(
HIWORD
(
wparam
)
==
BN_CLICKED
)
{
if
(
LOWORD
(
wparam
)
==
IDOK
)
{
HANDLE
hf
;
DWORD
len
=
SendDlgItemMessageW
(
hwnd
,
201
,
WM_GETTEXTLENGTH
,
0
,
0
);
LPWSTR
*
output
;
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
GetDlgItemTextW
(
hwnd
,
EDITBOX
,
filename
,
len
+
1
);
if
(
GetFileAttributesW
(
filename
)
!=
INVALID_FILE_ATTRIBUTES
)
{
WCHAR
caption
[
200
],
message
[
200
];
int
mb_ret
;
LoadStringW
(
WINSPOOL_hInstance
,
IDS_CAPTION
,
caption
,
sizeof
(
caption
)
/
sizeof
(
WCHAR
));
LoadStringW
(
WINSPOOL_hInstance
,
IDS_FILE_EXISTS
,
message
,
sizeof
(
message
)
/
sizeof
(
WCHAR
));
mb_ret
=
MessageBoxW
(
hwnd
,
message
,
caption
,
MB_OKCANCEL
|
MB_ICONEXCLAMATION
);
if
(
mb_ret
==
IDCANCEL
)
{
HeapFree
(
GetProcessHeap
(),
0
,
filename
);
return
TRUE
;
}
}
hf
=
CreateFileW
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hf
==
INVALID_HANDLE_VALUE
)
{
WCHAR
caption
[
200
],
message
[
200
];
LoadStringW
(
WINSPOOL_hInstance
,
IDS_CAPTION
,
caption
,
sizeof
(
caption
)
/
sizeof
(
WCHAR
));
LoadStringW
(
WINSPOOL_hInstance
,
IDS_CANNOT_OPEN
,
message
,
sizeof
(
message
)
/
sizeof
(
WCHAR
));
MessageBoxW
(
hwnd
,
message
,
caption
,
MB_OK
|
MB_ICONEXCLAMATION
);
HeapFree
(
GetProcessHeap
(),
0
,
filename
);
return
TRUE
;
}
CloseHandle
(
hf
);
DeleteFileW
(
filename
);
output
=
(
LPWSTR
*
)
GetWindowLongPtrW
(
hwnd
,
DWLP_USER
);
*
output
=
filename
;
EndDialog
(
hwnd
,
IDOK
);
return
TRUE
;
}
if
(
LOWORD
(
wparam
)
==
IDCANCEL
)
{
EndDialog
(
hwnd
,
IDCANCEL
);
return
TRUE
;
}
}
return
FALSE
;
}
return
FALSE
;
}
/*****************************************************************************
* schedule_file
*/
static
BOOL
schedule_file
(
LPCWSTR
filename
)
{
LPWSTR
output
=
NULL
;
if
(
DialogBoxParamW
(
WINSPOOL_hInstance
,
MAKEINTRESOURCEW
(
FILENAME_DIALOG
),
GetForegroundWindow
(),
file_dlg_proc
,
(
LPARAM
)
&
output
)
==
IDOK
)
{
TRACE
(
"copy to %s
\n
"
,
debugstr_w
(
output
));
CopyFileW
(
filename
,
output
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
output
);
return
TRUE
;
}
return
FALSE
;
}
/*****************************************************************************
* ScheduleJob [WINSPOOL.@]
*
...
...
@@ -4815,6 +4899,10 @@ BOOL WINAPI ScheduleJob( HANDLE hPrinter, DWORD dwJobID )
{
schedule_cups
(
pi5
->
pPortName
+
strlenW
(
CUPS_Port
),
job
->
filename
);
}
else
if
(
!
strncmpW
(
pi5
->
pPortName
,
FILE_Port
,
strlenW
(
FILE_Port
)))
{
schedule_file
(
job
->
filename
);
}
else
{
FIXME
(
"can't schedule to port %s
\n
"
,
debugstr_w
(
pi5
->
pPortName
));
...
...
dlls/winspool/winspool.rc
0 → 100644
View file @
e502d4dd
/*
* Top level resource file for winspool
*
* Copyright 2005 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wspool.h"
#include "En.rc"
dlls/winspool/wspool.c
View file @
e502d4dd
...
...
@@ -27,10 +27,11 @@
#include "winbase.h"
#include "wingdi.h"
#include "winspool.h"
#include "wspool.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winspool
);
HINSTANCE
WINSPOOL_hInstance
=
NULL
;
/******************************************************************************
* DllMain
...
...
@@ -43,8 +44,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD reason, LPVOID lpReserved)
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
{
extern
void
WINSPOOL_LoadSystemPrinters
(
void
);
WINSPOOL_hInstance
=
hInstance
;
DisableThreadLibraryCalls
(
hInstance
);
WINSPOOL_LoadSystemPrinters
();
break
;
...
...
dlls/winspool/wspool.h
0 → 100644
View file @
e502d4dd
/******************************************************************************
* winspool internal include file
*
*
* Copyright 2005 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
extern
HINSTANCE
WINSPOOL_hInstance
;
extern
void
WINSPOOL_LoadSystemPrinters
(
void
);
#define IDS_CAPTION 10
#define IDS_FILE_EXISTS 11
#define IDS_CANNOT_OPEN 12
#define FILENAME_DIALOG 100
#define EDITBOX 201
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