Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
0c71799d
Commit
0c71799d
authored
Jun 04, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Implement AddPortEx.
parent
60cde933
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
19 deletions
+116
-19
info.c
dlls/winspool.drv/info.c
+114
-15
winspool.h
include/winspool.h
+2
-4
No files found.
dlls/winspool.drv/info.c
View file @
0c71799d
...
...
@@ -6091,11 +6091,75 @@ BOOL WINAPI AddPortW(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName)
* See AddPortExW.
*
*/
BOOL
WINAPI
AddPortExA
(
HANDLE
hMonitor
,
LPSTR
pName
,
DWORD
Level
,
LPBYTE
lpBuffer
,
LPSTR
l
pMonitorName
)
BOOL
WINAPI
AddPortExA
(
LPSTR
pName
,
DWORD
level
,
LPBYTE
pBuffer
,
LPSTR
pMonitorName
)
{
FIXME
(
"(%p, %s, %d, %p, %s), stub!
\n
"
,
hMonitor
,
debugstr_a
(
pName
),
Level
,
lpBuffer
,
debugstr_a
(
lpMonitorName
));
return
FALSE
;
PORT_INFO_2W
pi2W
;
PORT_INFO_2A
*
pi2A
;
LPWSTR
nameW
=
NULL
;
LPWSTR
monitorW
=
NULL
;
DWORD
len
;
BOOL
res
;
pi2A
=
(
PORT_INFO_2A
*
)
pBuffer
;
TRACE
(
"(%s, %d, %p, %s): %s
\n
"
,
debugstr_a
(
pName
),
level
,
pBuffer
,
debugstr_a
(
pMonitorName
),
debugstr_a
(
pi2A
?
pi2A
->
pPortName
:
NULL
));
if
((
level
<
1
)
||
(
level
>
2
))
{
SetLastError
(
ERROR_INVALID_LEVEL
);
return
FALSE
;
}
if
(
!
pi2A
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
pName
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pName
,
-
1
,
NULL
,
0
);
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pName
,
-
1
,
nameW
,
len
);
}
if
(
pMonitorName
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pMonitorName
,
-
1
,
NULL
,
0
);
monitorW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pMonitorName
,
-
1
,
monitorW
,
len
);
}
ZeroMemory
(
&
pi2W
,
sizeof
(
PORT_INFO_2W
));
if
(
pi2A
->
pPortName
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pi2A
->
pPortName
,
-
1
,
NULL
,
0
);
pi2W
.
pPortName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pi2A
->
pPortName
,
-
1
,
pi2W
.
pPortName
,
len
);
}
if
(
level
>
1
)
{
if
(
pi2A
->
pMonitorName
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pi2A
->
pMonitorName
,
-
1
,
NULL
,
0
);
pi2W
.
pMonitorName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pi2A
->
pMonitorName
,
-
1
,
pi2W
.
pMonitorName
,
len
);
}
if
(
pi2A
->
pDescription
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pi2A
->
pDescription
,
-
1
,
NULL
,
0
);
pi2W
.
pDescription
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pi2A
->
pDescription
,
-
1
,
pi2W
.
pDescription
,
len
);
}
pi2W
.
fPortType
=
pi2A
->
fPortType
;
pi2W
.
Reserved
=
pi2A
->
Reserved
;
}
res
=
AddPortExW
(
nameW
,
level
,
(
LPBYTE
)
&
pi2W
,
monitorW
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
monitorW
);
HeapFree
(
GetProcessHeap
(),
0
,
pi2W
.
pPortName
);
HeapFree
(
GetProcessHeap
(),
0
,
pi2W
.
pMonitorName
);
HeapFree
(
GetProcessHeap
(),
0
,
pi2W
.
pDescription
);
return
res
;
}
/******************************************************************************
...
...
@@ -6104,25 +6168,60 @@ BOOL WINAPI AddPortExA(HANDLE hMonitor, LPSTR pName, DWORD Level, LPBYTE lpBuffe
* Add a Port for a specific Monitor, without presenting a user interface
*
* PARAMS
* hMonitor [I] Handle from InitializePrintMonitor2()
* pName [I] Servername or NULL (local Computer)
*
Level [I] Structure-Level (1 or 2) for l
pBuffer
*
lpBuffer
[I] PTR to: PORT_INFO_1 or PORT_INFO_2
*
lpMonitorName [I] Name of the Monitor that manage the Port or NULL
*
level [I] Structure-Level (1 or 2) for
pBuffer
*
pBuffer
[I] PTR to: PORT_INFO_1 or PORT_INFO_2
*
pMonitorName [I] Name of the Monitor that manage the Port
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* BUGS
* only a Stub
*
*/
BOOL
WINAPI
AddPortExW
(
HANDLE
hMonitor
,
LPWSTR
pName
,
DWORD
Level
,
LPBYTE
lpBuffer
,
LPWSTR
l
pMonitorName
)
BOOL
WINAPI
AddPortExW
(
LPWSTR
pName
,
DWORD
level
,
LPBYTE
pBuffer
,
LPWSTR
pMonitorName
)
{
FIXME
(
"(%p, %s, %d, %p, %s), stub!
\n
"
,
hMonitor
,
debugstr_w
(
pName
),
Level
,
lpBuffer
,
debugstr_w
(
lpMonitorName
));
return
FALSE
;
PORT_INFO_2W
*
pi2
;
monitor_t
*
pm
;
DWORD
res
=
FALSE
;
pi2
=
(
PORT_INFO_2W
*
)
pBuffer
;
TRACE
(
"(%s, %d, %p, %s): %s %s %s
\n
"
,
debugstr_w
(
pName
),
level
,
pBuffer
,
debugstr_w
(
pMonitorName
),
debugstr_w
(
pi2
?
pi2
->
pPortName
:
NULL
),
debugstr_w
(((
level
>
1
)
&&
pi2
)
?
pi2
->
pMonitorName
:
NULL
),
debugstr_w
(((
level
>
1
)
&&
pi2
)
?
pi2
->
pDescription
:
NULL
));
if
((
level
<
1
)
||
(
level
>
2
))
{
SetLastError
(
ERROR_INVALID_LEVEL
);
return
FALSE
;
}
if
(
!
pi2
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/* we need a valid Monitorname */
if
(
!
pMonitorName
)
{
SetLastError
(
RPC_X_NULL_REF_POINTER
);
return
FALSE
;
}
if
(
!
pMonitorName
[
0
])
{
SetLastError
(
ERROR_NOT_SUPPORTED
);
return
FALSE
;
}
/* load the Monitor */
pm
=
monitor_load
(
pMonitorName
,
NULL
);
if
(
!
pm
)
return
FALSE
;
if
(
pm
->
monitor
&&
pm
->
monitor
->
pfnAddPortEx
)
{
res
=
pm
->
monitor
->
pfnAddPortEx
(
pName
,
level
,
pBuffer
,
pMonitorName
);
TRACE
(
"got %u with %u
\n
"
,
res
,
GetLastError
());
}
monitor_unload
(
pm
);
return
res
;
}
/******************************************************************************
...
...
include/winspool.h
View file @
0c71799d
...
...
@@ -1349,10 +1349,8 @@ BOOL WINAPI AddPortA(LPSTR pName, HWND hWnd, LPSTR pMonitorName);
BOOL
WINAPI
AddPortW
(
LPWSTR
pName
,
HWND
hWnd
,
LPWSTR
pMonitorName
);
#define AddPort WINELIB_NAME_AW(AddPort)
BOOL
WINAPI
AddPortExA
(
HANDLE
hMonitor
,
LPSTR
pName
,
DWORD
Level
,
LPBYTE
lpBuffer
,
LPSTR
lpMonitorName
);
BOOL
WINAPI
AddPortExW
(
HANDLE
hMonitor
,
LPWSTR
pName
,
DWORD
Level
,
LPBYTE
lpBuffer
,
LPWSTR
lpMonitorName
);
BOOL
WINAPI
AddPortExA
(
LPSTR
,
DWORD
,
LPBYTE
,
LPSTR
);
BOOL
WINAPI
AddPortExW
(
LPWSTR
,
DWORD
,
LPBYTE
,
LPWSTR
);
#define AddPortEx WINELIB_NAME_AW(AddPortEx)
BOOL
WINAPI
ConfigurePortA
(
LPSTR
pName
,
HWND
hWnd
,
LPSTR
pPortName
);
...
...
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