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
473717fe
Commit
473717fe
authored
May 06, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
May 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Set PrinterPorts for win3.x/win9.x compatibility.
parent
a6746b9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
11 deletions
+42
-11
printdlg.c
dlls/comdlg32/tests/printdlg.c
+0
-2
info.c
dlls/winspool.drv/info.c
+42
-9
No files found.
dlls/comdlg32/tests/printdlg.c
View file @
473717fe
...
...
@@ -216,11 +216,9 @@ static void test_PrintDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
GetProfileStringA
(
PrinterPortsA
,
device
,
emptyA
,
buffer
,
sizeof
(
buffer
));
ptr
=
strchr
(
buffer
,
','
);
todo_wine
{
ok
(
(
res
>
1
)
&&
(
ptr
!=
NULL
),
"got %u with %u and %p for '%s' (expected '>1' and '!= NULL')
\n
"
,
res
,
GetLastError
(),
ptr
,
buffer
);
}
if
(
ptr
)
ptr
[
0
]
=
'\0'
;
todo_wine
{
...
...
dlls/winspool.drv/info.c
View file @
473717fe
...
...
@@ -187,6 +187,12 @@ static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\',
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'P'
,
'o'
,
'r'
,
't'
,
's'
,
0
};
static
const
WCHAR
WinNT_CV_PrinterPortsW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'P'
,
'o'
,
'r'
,
't'
,
's'
,
0
};
static
const
WCHAR
DefaultEnvironmentW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
envname_win40W
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'4'
,
'.'
,
'0'
,
0
};
static
const
WCHAR
envname_x86W
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
' '
,
'x'
,
'8'
,
'6'
,
0
};
...
...
@@ -225,6 +231,7 @@ static const WCHAR Previous_NamesW[] = {'P','r','e','v','i','o','u','s',' ','N',
static
const
WCHAR
Print_ProcessorW
[]
=
{
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
' '
,
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'o'
,
'r'
,
0
};
static
const
WCHAR
Printer_DriverW
[]
=
{
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
' '
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
PrinterDriverDataW
[]
=
{
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
PrinterPortsW
[]
=
{
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'P'
,
'o'
,
'r'
,
't'
,
's'
,
0
};
static
const
WCHAR
ProviderW
[]
=
{
'P'
,
'r'
,
'o'
,
'v'
,
'i'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
Separator_FileW
[]
=
{
'S'
,
'e'
,
'p'
,
'a'
,
'r'
,
'a'
,
't'
,
'o'
,
'r'
,
' '
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
Share_NameW
[]
=
{
'S'
,
'h'
,
'a'
,
'r'
,
'e'
,
' '
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
...
...
@@ -489,16 +496,26 @@ static BOOL CUPS_LoadPrinters(void)
nrofdests
=
pcupsGetDests
(
&
dests
);
TRACE
(
"Found %d CUPS %s:
\n
"
,
nrofdests
,
(
nrofdests
==
1
)
?
"printer"
:
"printers"
);
for
(
i
=
0
;
i
<
nrofdests
;
i
++
)
{
port
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
"LPR:"
)
+
strlen
(
dests
[
i
].
name
)
+
1
);
sprintf
(
port
,
"LPR:%s"
,
dests
[
i
].
name
);
devline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
"WINEPS.DRV,"
)
+
strlen
(
port
));
sprintf
(
devline
,
"WINEPS.DRV,%s"
,
port
);
WriteProfileStringA
(
"devices"
,
dests
[
i
].
name
,
devline
);
/* FIXME: replace "LPR:" with "CUPS:". Fix printing output first */
port
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
"LPR:"
)
+
strlen
(
dests
[
i
].
name
)
+
1
);
sprintf
(
port
,
"LPR:%s"
,
dests
[
i
].
name
);
/* FIXME: remove extension. Fix gdi32/drivers and comdlg32/printdlg first */
devline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
"WINEPS.DRV,,15,45"
)
+
strlen
(
port
));
sprintf
(
devline
,
"WINEPS.DRV,%s"
,
port
);
WriteProfileStringA
(
"devices"
,
dests
[
i
].
name
,
devline
);
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
user_printers_reg_key
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegSetValueExA
(
hkey
,
dests
[
i
].
name
,
0
,
REG_SZ
,
(
LPBYTE
)
devline
,
strlen
(
devline
)
+
1
);
RegCloseKey
(
hkey
);
}
HeapFree
(
GetProcessHeap
(),
0
,
devline
);
lstrcatA
(
devline
,
",15,45"
);
WriteProfileStringA
(
"PrinterPorts"
,
dests
[
i
].
name
,
devline
);
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
WinNT_CV_PrinterPortsW
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegSetValueExA
(
hkey
,
dests
[
i
].
name
,
0
,
REG_SZ
,
(
LPBYTE
)
devline
,
strlen
(
devline
)
+
1
);
RegCloseKey
(
hkey
);
}
HeapFree
(
GetProcessHeap
(),
0
,
devline
);
TRACE
(
"Printer %d: %s
\n
"
,
i
,
dests
[
i
].
name
);
if
(
RegOpenKeyA
(
hkeyPrinters
,
dests
[
i
].
name
,
&
hkeyPrinter
)
==
ERROR_SUCCESS
)
{
...
...
@@ -614,13 +631,22 @@ PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) {
port
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
"LPR:"
)
+
strlen
(
name
)
+
1
);
sprintf
(
port
,
"LPR:%s"
,
name
);
devline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
"WINEPS.DRV,"
)
+
strlen
(
port
));
sprintf
(
devline
,
"WINEPS.DRV,%s"
,
port
);
WriteProfileStringA
(
"devices"
,
devname
,
devline
);
/* FIXME: remove extension. Fix gdi32/drivers and comdlg32/printdlg first */
devline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
"WINEPS.DRV,,15,45"
)
+
strlen
(
port
));
sprintf
(
devline
,
"WINEPS.DRV,%s"
,
port
);
WriteProfileStringA
(
"devices"
,
devname
,
devline
);
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
user_printers_reg_key
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegSetValueExA
(
hkey
,
devname
,
0
,
REG_SZ
,
(
LPBYTE
)
devline
,
strlen
(
devline
)
+
1
);
RegCloseKey
(
hkey
);
}
lstrcatA
(
devline
,
",15,45"
);
WriteProfileStringA
(
"PrinterPorts"
,
devname
,
devline
);
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
WinNT_CV_PrinterPortsW
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegSetValueExA
(
hkey
,
devname
,
0
,
REG_SZ
,
(
LPBYTE
)
devline
,
strlen
(
devline
)
+
1
);
RegCloseKey
(
hkey
);
}
HeapFree
(
GetProcessHeap
(),
0
,
devline
);
if
(
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
PrintersW
,
&
hkeyPrinters
)
!=
...
...
@@ -3259,10 +3285,17 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter)
RegCloseKey
(
hkeyPrinters
);
}
WriteProfileStringW
(
devicesW
,
lpNameW
,
NULL
);
WriteProfileStringW
(
PrinterPortsW
,
lpNameW
,
NULL
);
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
user_printers_reg_key
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegDeleteValueW
(
hkey
,
lpNameW
);
RegCloseKey
(
hkey
);
}
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
WinNT_CV_PrinterPortsW
,
&
hkey
)
==
ERROR_SUCCESS
)
{
RegDeleteValueW
(
hkey
,
lpNameW
);
RegCloseKey
(
hkey
);
}
return
TRUE
;
}
...
...
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