Clarification Needed on DrvDocumentPropertySheets Function Documentation

本齐 谢 0 Reputation points
2024-11-28T03:38:52.3+00:00

The documentation for the DrvDocumentPropertySheets function in winddiui.h includes the following statement:

"If the fMode member of the DOCUMENTPROPERTYHEADER structure is zero, or if the pdmOut member of the same structure is NULL, the function should return just the total size of the printer's DEVMODEW structure, including public and private structure members, in the DOCUMENTPROPERTYHEADER structure's cbOut member."

Does this mean that the total size of the DEVMODEW structure should be set to the cbOut member and that value should also be returned?

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,657 questions
Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
142 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 本齐 谢 0 Reputation points
    2024-11-28T03:48:39.4366667+00:00

    The input value in the cbOut member is not necessarily equal to the size of the buffer pointed to by the pdmOut member. For example, when the pPSUInfo parameter of the DrvDocumentPropertySheets function is NULL, and if either the fMode member of the DOCUMENTPROPERTYHEADER structure is zero, or the pdmOut member of the same structure is NULL, a driver should write the total size of the printer's DEVMODEW structure (including the public and private structure members) in the cbOut member. In such a case, a driver should treat the cbOut member as a "write-only" member. Thus, your driver should not use cbOut member as the size of the buffer pointed to by the pdmOut member if the DrvDocumentPropertySheets function has been called. The "plotter" sample that ships with the Windows Driver Kit (WDK) demonstrates how to use the cbOut member correctly.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.