Help using WIDL to compile Microsoft IDL files

Questions about Wine on Linux
Locked
danf
Newbie
Newbie
Posts: 1
Joined: Thu Aug 05, 2021 1:35 pm

Help using WIDL to compile Microsoft IDL files

Post by danf »

I'm trying to use WIDL as an alternative to MIDL in a project I'm working on. I'm attempting to compile the MS-SCMR IDL file located at https://docs.microsoft.com/en-us/opensp ... 7f0f5e0241, which imports the MS-DTYP IDL from https://docs.microsoft.com/en-us/opensp ... 54b024280c

So I copy/pasted both IDL files into a local directory and tried to use WIDL to compile them

Code: Select all

❯ ls -lsa
total 48
 4 drwxrwxr-x 2 danf danf    4096 Aug  5 11:03 .
 4 drwxrwxrwx 3 danf danf    4096 Aug  5 10:14 ..
 8 -rw-r--r-- 1 danf ubuntu  6561 Aug  5 10:54 ms-dtyp.idl
32 -rw-r--r-- 1 danf ubuntu 30894 Aug  5 10:54 ms-scmr.idl
❯ 
❯ widl ms-scmr.idl
ms-dtyp.idl:1: error: syntax error, unexpected tWCHAR
❯ widl ms-dtyp.idl
ms-dtyp.idl:1: error: syntax error, unexpected tWCHAR
❯ 
❯ cat -n ms-dtyp.idl
     1	 typedef unsigned short wchar_t;
     2	 typedef void* ADCONNECTION_HANDLE;
     3	 typedef int BOOL, *PBOOL, *LPBOOL;
     4	 typedef unsigned char BYTE, *PBYTE, *LPBYTE;
     5	 typedef BYTE BOOLEAN, *PBOOLEAN;
     ... <snip>
The first line of MS-DTYP is very straight forward, so I'm not sure why it's erroring out. I've tried a number of combinations of options to WIDL but nothing changes the output.

I tried removing that line and trying to compile it by itself but got a similar error a few lines down:

Code: Select all

❯ widl ms-dtyp.idl
ms-dtyp.idl:15: error: syntax error, unexpected tERRORSTATUST
❯
❯ cat -n ms-dtyp.idl
     1	 
     2	 typedef void* ADCONNECTION_HANDLE;
     3	 typedef int BOOL, *PBOOL, *LPBOOL;
     4	 typedef unsigned char BYTE, *PBYTE, *LPBYTE;
     5	 typedef BYTE BOOLEAN, *PBOOLEAN;
     6	 typedef wchar_t WCHAR, *PWCHAR;
     7	 typedef WCHAR* BSTR;
     8	 typedef char CHAR, *PCHAR;
     9	 typedef double DOUBLE;
    10	 typedef unsigned long DWORD, *PDWORD, *LPDWORD;
    11	 typedef unsigned int DWORD32;
    12	 typedef unsigned __int64 DWORD64, *PDWORD64;
    13	 typedef unsigned __int64 ULONGLONG;
    14	 typedef ULONGLONG DWORDLONG, *PDWORDLONG;
    15	 typedef unsigned long error_status_t;
    16	 typedef float FLOAT;
    17	 typedef unsigned char UCHAR, *PUCHAR;
    18	 typedef short SHORT;
    ... <snip>
Locked