Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fce002c3
Commit
fce002c3
authored
Apr 17, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Apr 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Implement XcvData_AddPort.
parent
3775c9c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
3 deletions
+57
-3
Makefile.in
dlls/localspl/Makefile.in
+1
-1
localmon.c
dlls/localspl/localmon.c
+56
-2
No files found.
dlls/localspl/Makefile.in
View file @
fce002c3
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
localspl.dll
IMPORTS
=
user32 advapi32 kernel32
IMPORTS
=
spoolss
user32 advapi32 kernel32
C_SRCS
=
\
localmon.c
\
...
...
dlls/localspl/localmon.c
View file @
fce002c3
...
...
@@ -65,6 +65,7 @@ static struct list xcv_handles = LIST_INIT( xcv_handles );
/* ############################### */
static
const
WCHAR
cmd_AddPortW
[]
=
{
'A'
,
'd'
,
'd'
,
'P'
,
'o'
,
'r'
,
't'
,
0
};
static
const
WCHAR
cmd_DeletePortW
[]
=
{
'D'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
'P'
,
'o'
,
'r'
,
't'
,
0
};
static
const
WCHAR
cmd_ConfigureLPTPortCommandOKW
[]
=
{
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'u'
,
'r'
,
'e'
,
'L'
,
'P'
,
'T'
,
'P'
,
'o'
,
'r'
,
't'
,
...
...
@@ -85,6 +86,7 @@ static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
'C'
,
'o'
,
'm'
,
'm'
,
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
0
};
static
const
WCHAR
dllnameuiW
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'u'
,
'i'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
portname_LPT
[]
=
{
'L'
,
'P'
,
'T'
,
0
};
static
const
WCHAR
portname_COM
[]
=
{
'C'
,
'O'
,
'M'
,
0
};
...
...
@@ -126,6 +128,44 @@ static void dlg_nothingtoconfig(HWND hWnd)
}
/******************************************************************
* does_port_exist (internal)
*
* returns TRUE, when the Port already exists
*
*/
static
BOOL
does_port_exist
(
LPCWSTR
myname
)
{
LPPORT_INFO_1W
pi
;
DWORD
needed
=
0
;
DWORD
returned
;
DWORD
id
;
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
myname
));
id
=
EnumPortsW
(
NULL
,
1
,
NULL
,
0
,
&
needed
,
&
returned
);
pi
=
spl_alloc
(
needed
);
returned
=
0
;
if
(
pi
)
id
=
EnumPortsW
(
NULL
,
1
,
(
LPBYTE
)
pi
,
needed
,
&
needed
,
&
returned
);
if
(
id
&&
returned
>
0
)
{
/* we got a number of valid names. */
for
(
id
=
0
;
id
<
returned
;
id
++
)
{
if
(
lstrcmpiW
(
myname
,
pi
[
id
].
pName
)
==
0
)
{
TRACE
(
"(%u) found %s
\n
"
,
id
,
debugstr_w
(
pi
[
id
].
pName
));
spl_free
(
pi
);
return
TRUE
;
}
}
}
spl_free
(
pi
);
return
FALSE
;
}
/******************************************************************
* enumerate the local Ports from the Registry (internal)
*
* See localmon_EnumPortsW.
...
...
@@ -459,8 +499,22 @@ DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInput
TRACE
(
"(%p, %s, %p, %d, %p, %d, %p)
\n
"
,
hXcv
,
debugstr_w
(
pszDataName
),
pInputData
,
cbInputData
,
pOutputData
,
cbOutputData
,
pcbOutputNeeded
);
/* Native localspl.dll crashes on w2k and xp, when XcvDataPort is called
with "AddPort" as command. We do not need to implement this */
if
(
!
lstrcmpW
(
pszDataName
,
cmd_AddPortW
))
{
TRACE
(
"InputData (%d): %s
\n
"
,
cbInputData
,
debugstr_w
(
(
LPWSTR
)
pInputData
));
res
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
WinNT_CV_PortsW
,
&
hroot
);
if
(
res
==
ERROR_SUCCESS
)
{
if
(
does_port_exist
((
LPWSTR
)
pInputData
))
{
RegCloseKey
(
hroot
);
return
ERROR_ALREADY_EXISTS
;
}
res
=
RegSetValueExW
(
hroot
,
(
LPWSTR
)
pInputData
,
0
,
REG_SZ
,
(
const
BYTE
*
)
emptyW
,
sizeof
(
emptyW
));
RegCloseKey
(
hroot
);
SetLastError
(
ERROR_SUCCESS
);
return
res
;
}
return
res
;
}
if
(
!
lstrcmpW
(
pszDataName
,
cmd_ConfigureLPTPortCommandOKW
))
{
TRACE
(
"InputData (%d): %s
\n
"
,
cbInputData
,
debugstr_w
(
(
LPWSTR
)
pInputData
));
...
...
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