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
cecaf91d
Commit
cecaf91d
authored
Apr 17, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Apr 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localui: Implement DeletePortUI.
parent
fce002c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
3 deletions
+75
-3
Makefile.in
dlls/localui/Makefile.in
+1
-1
localui.c
dlls/localui/localui.c
+74
-2
No files found.
dlls/localui/Makefile.in
View file @
cecaf91d
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
localui.dll
IMPORTS
=
kernel32
IMPORTS
=
winspool
kernel32
C_SRCS
=
\
localui.c
...
...
dlls/localui/localui.c
View file @
cecaf91d
...
...
@@ -36,6 +36,50 @@ WINE_DEFAULT_DEBUG_CHANNEL(localui);
static
HINSTANCE
LOCALUI_hInstance
;
static
const
WCHAR
cmd_DeletePortW
[]
=
{
'D'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
'P'
,
'o'
,
'r'
,
't'
,
0
};
static
const
WCHAR
XcvPortW
[]
=
{
','
,
'X'
,
'c'
,
'v'
,
'P'
,
'o'
,
'r'
,
't'
,
' '
,
0
};
/*****************************************************
* strdupWW [internal]
*/
static
LPWSTR
strdupWW
(
LPCWSTR
pPrefix
,
LPCWSTR
pSuffix
)
{
LPWSTR
ptr
;
DWORD
len
;
len
=
lstrlenW
(
pPrefix
)
+
lstrlenW
(
pSuffix
)
+
1
;
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
ptr
)
{
lstrcpyW
(
ptr
,
pPrefix
);
lstrcatW
(
ptr
,
pSuffix
);
}
return
ptr
;
}
/*****************************************************
* open_monitor_by_name [internal]
*
*/
static
BOOL
open_monitor_by_name
(
LPCWSTR
pPrefix
,
LPCWSTR
pPort
,
HANDLE
*
phandle
)
{
PRINTER_DEFAULTSW
pd
;
LPWSTR
fullname
;
BOOL
res
;
*
phandle
=
0
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_w
(
pPrefix
),
debugstr_w
(
pPort
)
);
fullname
=
strdupWW
(
pPrefix
,
pPort
);
pd
.
pDatatype
=
NULL
;
pd
.
pDevMode
=
NULL
;
pd
.
DesiredAccess
=
SERVER_ACCESS_ADMINISTER
;
res
=
OpenPrinterW
(
fullname
,
phandle
,
&
pd
);
HeapFree
(
GetProcessHeap
(),
0
,
fullname
);
return
res
;
}
/*****************************************************
* localui_AddPortUI [exported through MONITORUI]
*
...
...
@@ -94,11 +138,39 @@ static BOOL WINAPI localui_ConfigurePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPort
* Success: TRUE
* Failure: FALSE
*
* NOTES
* Native localui does not allow to delete a COM / LPT - Port (ERROR_NOT_SUPPORTED)
*
*/
static
BOOL
WINAPI
localui_DeletePortUI
(
PCWSTR
pName
,
HWND
hWnd
,
PCWSTR
pPortName
)
{
FIXME
(
"(%s, %p, %s) stub
\n
"
,
debugstr_w
(
pName
),
hWnd
,
debugstr_w
(
pPortName
));
return
TRUE
;
HANDLE
hXcv
;
DWORD
dummy
;
DWORD
needed
;
DWORD
status
;
TRACE
(
"(%s, %p, %s)
\n
"
,
debugstr_w
(
pName
),
hWnd
,
debugstr_w
(
pPortName
));
if
((
!
pPortName
)
||
(
!
pPortName
[
0
]))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
open_monitor_by_name
(
XcvPortW
,
pPortName
,
&
hXcv
))
{
/* native localui tests here for LPT / COM - Ports and failed with
ERROR_NOT_SUPPORTED. */
if
(
XcvDataW
(
hXcv
,
cmd_DeletePortW
,
(
LPBYTE
)
pPortName
,
(
lstrlenW
(
pPortName
)
+
1
)
*
sizeof
(
WCHAR
),
(
LPBYTE
)
&
dummy
,
0
,
&
needed
,
&
status
))
{
ClosePrinter
(
hXcv
);
if
(
status
!=
ERROR_SUCCESS
)
SetLastError
(
status
);
return
(
status
==
ERROR_SUCCESS
);
}
ClosePrinter
(
hXcv
);
return
FALSE
;
}
SetLastError
(
ERROR_UNKNOWN_PORT
);
return
FALSE
;
}
/*****************************************************
...
...
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