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
c9663015
Commit
c9663015
authored
Dec 09, 2007
by
Marcel Partap
Committed by
Alexandre Julliard
Dec 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool.drv/tests: Add dumping of FORM_INFO_1/2 in test_EnumForms.
parent
3252ddc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
info.c
dlls/winspool.drv/tests/info.c
+32
-4
No files found.
dlls/winspool.drv/tests/info.c
View file @
c9663015
...
@@ -768,7 +768,12 @@ static void test_EnumForms(LPSTR pName)
...
@@ -768,7 +768,12 @@ static void test_EnumForms(LPSTR pName)
DWORD
pcbNeeded
;
DWORD
pcbNeeded
;
DWORD
pcReturned
;
DWORD
pcReturned
;
DWORD
level
;
DWORD
level
;
INT
i
;
const
char
*
formtype
;
static
const
char
*
const
formtypes
[]
=
{
"FORM_USER"
,
"FORM_BUILTIN"
,
"FORM_PRINTER"
,
"FORM_flag_unknown"
};
#define FORMTYPE_MAX 2
PFORM_INFO_1A
pFI_1a
;
PFORM_INFO_2A
pFI_2a
;
res
=
OpenPrinter
(
pName
,
&
hprinter
,
NULL
);
res
=
OpenPrinter
(
pName
,
&
hprinter
,
NULL
);
RETURN_ON_DEACTIVATED_SPOOLER
(
res
)
RETURN_ON_DEACTIVATED_SPOOLER
(
res
)
...
@@ -785,7 +790,7 @@ static void test_EnumForms(LPSTR pName)
...
@@ -785,7 +790,7 @@ static void test_EnumForms(LPSTR pName)
pcReturned
=
0xdeadbeef
;
pcReturned
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
res
=
EnumFormsA
(
hprinter
,
level
,
NULL
,
0
,
&
cbBuf
,
&
pcReturned
);
res
=
EnumFormsA
(
hprinter
,
level
,
NULL
,
0
,
&
cbBuf
,
&
pcReturned
);
/* EnumForms is not implemented in win9x */
/* EnumForms is not implemented in win9x */
if
(
!
res
&&
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
))
continue
;
if
(
!
res
&&
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
))
continue
;
...
@@ -803,7 +808,7 @@ static void test_EnumForms(LPSTR pName)
...
@@ -803,7 +808,7 @@ static void test_EnumForms(LPSTR pName)
"ERROR_INVALID_LEVEL or '!=0' and 0x0)
\n
"
,
"ERROR_INVALID_LEVEL or '!=0' and 0x0)
\n
"
,
level
,
res
,
GetLastError
(),
pcReturned
);
level
,
res
,
GetLastError
(),
pcReturned
);
continue
;
continue
;
}
}
ok
((
!
res
)
&&
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
ok
((
!
res
)
&&
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
"(%d) returned %d with %d (expected '0' with "
"(%d) returned %d with %d (expected '0' with "
...
@@ -816,8 +821,31 @@ static void test_EnumForms(LPSTR pName)
...
@@ -816,8 +821,31 @@ static void test_EnumForms(LPSTR pName)
res
=
EnumFormsA
(
hprinter
,
level
,
buffer
,
cbBuf
,
&
pcbNeeded
,
&
pcReturned
);
res
=
EnumFormsA
(
hprinter
,
level
,
buffer
,
cbBuf
,
&
pcbNeeded
,
&
pcReturned
);
ok
(
res
,
"(%d) returned %d with %d (expected '!=0')
\n
"
,
ok
(
res
,
"(%d) returned %d with %d (expected '!=0')
\n
"
,
level
,
res
,
GetLastError
());
level
,
res
,
GetLastError
());
/* We can dump the returned Data here */
if
(
winetest_debug
>
1
)
{
trace
(
"dumping %d forms level %d
\n
"
,
pcReturned
,
level
);
pFI_1a
=
(
PFORM_INFO_1A
)
buffer
;
pFI_2a
=
(
PFORM_INFO_2A
)
buffer
;
for
(
i
=
0
;
i
<
pcReturned
;
i
++
)
{
/* first part is same in FORM_INFO_1 and FORM_INFO_2 */
formtype
=
(
pFI_1a
->
Flags
<=
FORMTYPE_MAX
)
?
formtypes
[
pFI_1a
->
Flags
]
:
formtypes
[
3
];
trace
(
"%u (%s): %.03fmm x %.03fmm, %s
\n
"
,
i
,
pFI_1a
->
pName
,
(
float
)
pFI_1a
->
Size
.
cx
/
1000
,
(
float
)
pFI_1a
->
Size
.
cy
/
1000
,
formtype
);
if
(
level
==
1
)
pFI_1a
++
;
else
{
/* output additional FORM_INFO_2 fields */
trace
(
"
\t
keyword=%s strtype=%u muidll=%s resid=%u dispname=%s langid=%u
\n
"
,
pFI_2a
->
pKeyword
,
pFI_2a
->
StringType
,
pFI_2a
->
pMuiDll
,
pFI_2a
->
dwResourceId
,
pFI_2a
->
pDisplayName
,
pFI_2a
->
wLangId
);
/* offset pointer pFI_1a by 1*sizeof(FORM_INFO_2A) Bytes */
pFI_2a
++
;
pFI_1a
=
(
PFORM_INFO_1A
)
pFI_2a
;
}
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
res
=
EnumFormsA
(
hprinter
,
level
,
buffer
,
cbBuf
+
1
,
&
pcbNeeded
,
&
pcReturned
);
res
=
EnumFormsA
(
hprinter
,
level
,
buffer
,
cbBuf
+
1
,
&
pcbNeeded
,
&
pcReturned
);
...
...
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