Skip to content

Commit bce1b24

Browse files
mamoreau-devolutionsawakecoding
authored andcommitted
fix x86 build conflict with LONG_PTR, UINT_PTR types
1 parent 4537f48 commit bce1b24

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

com/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,18 @@ The resulting .IDL file needs to be manually edited to fix type declaration orde
3535
```powershell
3636
midl.exe .\mstscax.idl /notlb /header mstscax.h /iid mstscax_i.c
3737
```
38+
39+
In 32-bit mode, the generated headers define UINT_PTR and LONG_PTR types that can cause conflicts, use this code snippet to comment them out:
40+
41+
```powershell
42+
'mstscax.tlh', 'mstscax.h' | ForEach-Object {
43+
$file = $_
44+
(Get-Content $file) | ForEach-Object {
45+
if ($_ -match '^\s*typedef\s+.*?_PTR;') {
46+
'// ' + $_
47+
} else {
48+
$_
49+
}
50+
} | Set-Content $file
51+
}
52+
```

com/mstscax.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,9 @@ enum __MIDL___MIDL_itf_mstscax_0001_0009_0002
10031003
controlCloseWaitForEvents = 1
10041004
} ;
10051005

1006-
typedef /* [custom][public] */ UINT64 UINT_PTR;
1006+
// typedef /* [custom][public] */ UINT64 UINT_PTR;
10071007

1008-
typedef /* [custom][public] */ INT64 LONG_PTR;
1008+
// typedef /* [custom][public] */ INT64 LONG_PTR;
10091009

10101010
typedef /* [public][public] */
10111011
enum __MIDL___MIDL_itf_mstscax_0001_0046_0001

com/mstscax.tlh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ typedef enum __MIDL___MIDL_itf_mstsax_0000_0057_0002 RemoteWindowDisplayedAttrib
170170
typedef enum __MIDL___MIDL_itf_mstsax_0000_0000_0001 ExtendedDisconnectReasonCode;
171171
typedef enum __MIDL_IMsRdpClient_0001 ControlCloseStatus;
172172
#if !defined(_WIN64)
173-
typedef __w64 unsigned long UINT_PTR;
173+
// typedef __w64 unsigned long UINT_PTR;
174174
#else
175-
typedef unsigned __int64 UINT_PTR;
175+
// typedef unsigned __int64 UINT_PTR;
176176
#endif
177177
#if !defined(_WIN64)
178-
typedef __w64 long LONG_PTR;
178+
// typedef __w64 long LONG_PTR;
179179
#else
180-
typedef __int64 LONG_PTR;
180+
// typedef __int64 LONG_PTR;
181181
#endif
182182
typedef enum __MIDL_IMsRdpClientNonScriptable4_0001 RedirectionWarningType;
183183
typedef enum __MIDL___MIDL_itf_mstsax_0000_0000_0004 RemoteSessionActionType;

0 commit comments

Comments
 (0)