Open mayd opened 1 year ago
Header files are manually added in mingw-w64 repository. If you would like to wait I can try to work on this. IWiaDevMgr2 interface needs so many other interface declaration. Adding IDL file in mingw-w64 would be better option. It may need some time.
I had started looking into fixing this bug myself.
First I looked at the current Microsoft SDK version 10 include files, I notice there are three main ones: Wia.h
, Wia_xp.h
, Wia_lh.h
.
Unlike the MINGW wia.h
, the Microsoft SDK Wia.h
is merely a stub containing an #ifdef
macro to select either the WIA 1.0 include file Wia_xp.h
, or the WIA 2.0 include file Wia_lh.h
, depending on the target platform. (WIA 1.0 is not supported on Windows versions after Windows XP.)
Next, I looked at the WineHQ website. They appear to have reverse engineered the unpublished Microsoft COM IDL file for WIA 1.0. They wrote two IDL files: wia_xp.idl
and wia_lh.idl
. They regenerated the corresponding include files wia_xp.h
and wia_lh.h
from the IDL files with the WIDL tool, and they also copied the Microsoft SDK stub wia.h
.
However, crucially, the WineHQ version of wia_lh.idl
is merely a duplicate of their wia_xp.idl
and, therefore, is obviously useless, as it contains no WIA 2.0 definitions.
(I also checked the ReactOS website; it has identical files to those at WineHQ for WIA support.)
The problem to be solved is the complete absence of WIA 2.0 support. I intended follow the WinHQ approach to ensure compatibility with WinHQ and the Microsoft SDK. I would write the missing (correct) wia_lh.idl
and update any additional include files such as wiadefs.h
, wiadevd.h
, wiavideo.h
, if needed.
I was pleased, and surprised, to learn you have already submitted a patch as reverse engineering the WIA 2.0 IDL file and additional files seemed to be a lot of work!
I would be interested in testing your patch.
mingw-w64 maintainers asked to upstream the IDL files to wine project first. I am working on that.
Description / Steps to reproduce the issue
When I attempted to compile code from several C++ examples on the Microsoft Windows Image Acquisition (WIA) tutorial Web pages https://learn.microsoft.com/en-us/windows/win32/wia/-wia-wia-tutorial, the MINGW compiler returned errors due to missing declarations.
E.g. the following code (based on https://learn.microsoft.com/en-us/windows/win32/wia/-wia-creating-a-wia-device-manager):
Expected behavior
The command
c++ -c wia-create-dev-mgr.cpp
should compile the source to to an object file.Actual behavior
The above code failed to compile and the following error message was displayed:
The above code and other examples did compile using include files copied from a recent version of the Microsoft Windows SDK.
Verification
Windows Version
MINGW64_NT-10.0-22631
MINGW environments affected
Are you willing to submit a PR?
Yes