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
97f95d4c
Commit
97f95d4c
authored
Jun 14, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Implement AddPortEx.
parent
cb257472
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
2 deletions
+60
-2
localmon.c
dlls/localspl/localmon.c
+60
-2
No files found.
dlls/localspl/localmon.c
View file @
97f95d4c
...
@@ -85,6 +85,7 @@ static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
...
@@ -85,6 +85,7 @@ static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
static
const
WCHAR
dllnameuiW
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'u'
,
'i'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
dllnameuiW
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'u'
,
'i'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
LocalPortW
[]
=
{
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
' '
,
'P'
,
'o'
,
'r'
,
't'
,
0
};
static
const
WCHAR
portname_LPT
[]
=
{
'L'
,
'P'
,
'T'
,
0
};
static
const
WCHAR
portname_LPT
[]
=
{
'L'
,
'P'
,
'T'
,
0
};
static
const
WCHAR
portname_COM
[]
=
{
'C'
,
'O'
,
'M'
,
0
};
static
const
WCHAR
portname_COM
[]
=
{
'C'
,
'O'
,
'M'
,
0
};
...
@@ -298,6 +299,63 @@ static DWORD get_type_from_name(LPCWSTR name)
...
@@ -298,6 +299,63 @@ static DWORD get_type_from_name(LPCWSTR name)
return
PORT_IS_UNKNOWN
;
return
PORT_IS_UNKNOWN
;
}
}
/******************************************************************************
* localmon_AddPortExW [exported through MONITOREX]
*
* Add a Port, without presenting a user interface
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* level [I] Structure-Level (1) for pBuffer
* pBuffer [I] PTR to the Input-Data (PORT_INFO_1)
* pMonitorName [I] Name of the Monitor that manage the Port
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* Level 2 is documented on MSDN for Portmonitors, but not supported by the
* "Local Port" Portmonitor (localspl.dll / localmon.dll)
*/
BOOL
WINAPI
localmon_AddPortExW
(
LPWSTR
pName
,
DWORD
level
,
LPBYTE
pBuffer
,
LPWSTR
pMonitorName
)
{
PORT_INFO_1W
*
pi
;
HKEY
hroot
;
DWORD
res
;
pi
=
(
PORT_INFO_1W
*
)
pBuffer
;
TRACE
(
"(%s, %d, %p, %s) => %s
\n
"
,
debugstr_w
(
pName
),
level
,
pBuffer
,
debugstr_w
(
pMonitorName
),
debugstr_w
(
pi
?
pi
->
pName
:
NULL
));
if
((
pMonitorName
==
NULL
)
||
(
lstrcmpiW
(
pMonitorName
,
LocalPortW
)
!=
0
)
||
(
pi
==
NULL
)
||
(
pi
->
pName
==
NULL
)
||
(
pi
->
pName
[
0
]
==
'\0'
)
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
level
!=
1
)
{
SetLastError
(
ERROR_INVALID_LEVEL
);
return
FALSE
;
}
res
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
WinNT_CV_PortsW
,
&
hroot
);
if
(
res
==
ERROR_SUCCESS
)
{
if
(
does_port_exist
(
pi
->
pName
))
{
RegCloseKey
(
hroot
);
TRACE
(
"=> FALSE with %u
\n
"
,
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
res
=
RegSetValueExW
(
hroot
,
pi
->
pName
,
0
,
REG_SZ
,
(
const
BYTE
*
)
emptyW
,
sizeof
(
emptyW
));
RegCloseKey
(
hroot
);
}
if
(
res
!=
ERROR_SUCCESS
)
SetLastError
(
ERROR_INVALID_PARAMETER
);
TRACE
(
"=> %u with %u
\n
"
,
(
res
==
ERROR_SUCCESS
),
GetLastError
());
return
(
res
==
ERROR_SUCCESS
);
}
/*****************************************************
/*****************************************************
* localmon_EnumPortsW [exported through MONITOREX]
* localmon_EnumPortsW [exported through MONITOREX]
*
*
...
@@ -607,8 +665,8 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
...
@@ -607,8 +665,8 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
NULL
,
/* localmon_ReadPortW */
NULL
,
/* localmon_ReadPortW */
NULL
,
/* localmon_EndDocPortW */
NULL
,
/* localmon_EndDocPortW */
NULL
,
/* localmon_ClosePortW */
NULL
,
/* localmon_ClosePortW */
NULL
,
/*
localmon_AddPortW
*/
NULL
,
/*
Use AddPortUI in localui.dll
*/
NULL
,
/* localmon_AddPortExW */
localmon_AddPortExW
,
NULL
,
/* Use ConfigurePortUI in localui.dll */
NULL
,
/* Use ConfigurePortUI in localui.dll */
NULL
,
/* Use DeletePortUI in localui.dll */
NULL
,
/* Use DeletePortUI in localui.dll */
NULL
,
/* localmon_GetPrinterDataFromPort */
NULL
,
/* localmon_GetPrinterDataFromPort */
...
...
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