I checked, corrected and changed all WinAPI structures for PB4.61 (beta). Here some informations about it.
There are quite some changes:
About the removed members that are > Win95 only:
The PB team is thinking about a more general solution to this problem because many more structures have new members for new versions of Windows.
Please be patient, only 4 structures were changed because of this.
For now you have to create new structures with Extends if you used one of this structures.
About the renamed members for many structures:
If your source uses one of the structures with renamed members, the compiler will give you an error about missing/unknown member in your source.
If this is the case, please open the structure viewer tool and check the members or look in the list below.
I wrote some small tools with PureBasic and C++ to automate the checking
of WinAPI structures a little bit.
With this tools the PB team can check all included WinAPI structures for:
There are 3 checks that are done between VisualC++ and PureBasic and for all 4 modes:
To automate this checks with C++ and PB tools, PB structures and
its members need to have exactly the same names/spelling for members
as in the MS Windows Platform SDK.
This is the reason some structure members had to be renamed.
It makes it easier to automate the WinAPI structure checking. Now and for future versions of PureBasic.
Here is a complete list for reference with all my changes:
(i hope Fred didn't change anything after that )
There are quite some changes:
- 4 structures have members removed because they are not Win95 compatible, please read below
- 2 structures have been renamed because of spelling mistakes before
- 3 structures were added because required to fix other structures some structure members had to be rename, please read below
About the removed members that are > Win95 only:
The PB team is thinking about a more general solution to this problem because many more structures have new members for new versions of Windows.
Please be patient, only 4 structures were changed because of this.
For now you have to create new structures with Extends if you used one of this structures.
About the renamed members for many structures:
If your source uses one of the structures with renamed members, the compiler will give you an error about missing/unknown member in your source.
If this is the case, please open the structure viewer tool and check the members or look in the list below.
I wrote some small tools with PureBasic and C++ to automate the checking
of WinAPI structures a little bit.
With this tools the PB team can check all included WinAPI structures for:
- PureBasic Windows 32bit
- PureBasic Windows 32bit, Unicode
- PureBasic Windows 64bit
- PureBasic Windows 64bit, Unicode
There are 3 checks that are done between VisualC++ and PureBasic and for all 4 modes:
- compare the structure size
- compare the size of all members within the structure
- compare the offset of all members within the structure
To automate this checks with C++ and PB tools, PB structures and
its members need to have exactly the same names/spelling for members
as in the MS Windows Platform SDK.
This is the reason some structure members had to be renamed.
It makes it easier to automate the WinAPI structure checking. Now and for future versions of PureBasic.
Here is a complete list for reference with all my changes:
(i hope Fred didn't change anything after that )
Code : | Sélectionner tout |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | ;>----------------------------------------------------------------------------------- ; ;- removed members For Win95 compatibility (WINVER = 0x0400) ; ;>----------------------------------------------------------------------------------- MENUITEMINFO \ hbmpItem.i removed, WINVER >= 0x0500, = Windows 2000+ LV_ITEM \ iGroupId removed, WINVER >= 0x0501, = Windows XP+ \ cColumns removed, WINVER >= 0x0501, = Windows XP+ \ puColumns removed, WINVER >= 0x0501, = Windows XP+ \ piColFmt removed, WINVER >= 0x0600, = Windows Vista+ \ iGroup removed, WINVER >= 0x0600, = Windows Vista+ LV_HITTESTINFO \ iGroup remoced, WINVER >= 0x0600, = Windows Vista+ LV_COLUMN \ cxMin remoced, WINVER >= 0x0600, = Windows Vista+ \ cxDefault remoced, WINVER >= 0x0600, = Windows Vista+ \ cxIdeal remoced, WINVER >= 0x0600, = Windows Vista+ ;>----------------------------------------------------------------------------------- ;- renamed structures ;>----------------------------------------------------------------------------------- EMRSAVEDC renamed, was EMREMRSAVEDC EMRPOLYBEZIERTO16 renamed, was EMRPLOYBEZIERTO16 ;>----------------------------------------------------------------------------------- ;- added structures ;>----------------------------------------------------------------------------------- EXTLOGPEN32 added, required by EMREXTCREATEPEN LOGCOLORSPACEA added, lcsFileName always ASCII -> required by EMRCREATECOLORSPACE LOGCOLORSPACEW added, lcsFileName always UNICODE ;>----------------------------------------------------------------------------------- ;- general fixes ;>----------------------------------------------------------------------------------- PERF_DATA_BLOCK alignment For x86 And x64 DEV_BROADCAST_USERDEFINED alignment For x86 And x64 EMREXTCREATEPEN \ elp.EXTLOGPEN -> elp.EXTLOGPEN32 MENUITEMTEMPLATE \ mtString.b -> mtString.u[1] MIXERCONTROLDETAILS \ item.i -> StructureUnion With hwndOwner.i And cMultipleItems.l LANA_ENUM \ lana.b[#MAX_LANA] -> lana.b[#MAX_LANA+1], alignment PELARRAY \ paRGBs .w To .a And corrected alignment after URL_COMPONENTS \ nPort .l To .w And corrected alignment after RB_HITTESTINFO \ iBand .w To .l MENUITEMINFO \ dwTypeData .l To .u VARIANT \ cyVal .l To .LARGE_INTEGER EMRCREATECOLORSPACE \ lcs.LOGCOLORSPACE To .LOGCOLORSPACEA NAME_BUFFER \ name_num .b To .a \ name_flags .b To .a M128A \ changed both .i To .q OUTLINETEXTMETRIC \ otmsUnderscoreSize -> corrected position within the Structure INPUT_RECORD \ changed the StructureUnion to Event.INPUT_RECORD_EVENT SAFEARRAY \ added StructureUnion With dummyrgsabound member \ rgsabound moved into same StructureUnion FORM_INFO_1 *pName.l -> *pName.Character DEVMODE \ added dmPanningWidth, matches _WIN32_WINNT_NT4 0x0400 \ added dmPanningHeight, matches _WIN32_WINNT_NT4 0x0400 MULTIKEYHELP corrected For unicode HELPWININFO corrected For unicode MONHSZSTRUCT corrected For unicode DEV_BROADCAST_PORT corrected For unicode ;>----------------------------------------------------------------------------------- ; ;- fixed For 64bit: ; ;>----------------------------------------------------------------------------------- NMOBJECTNOTIFY hResult changed from .i To .l And corrected alignment NMHDR idFrom changed from .l To .i And corrected alignment MCI_STATUS_PARMS dwReturn changed from .l To .i And corrected alignment HELPINFO dwContextId changed from .l To .i And corrected alignment ENDROPFILES hDrop changed from .l To .i And corrected alignment MIXERLINE dwUser changed from .l To .i And corrected alignment LOGBRUSH lbHatch changed from .l To .i ICMP_ECHO_REPLY Data changed from .l To .i IP_OPTION_INFORMATION \ Ttl changed from .b To .a \ Tos changed from .b To .a \ Flags changed from .b To .a \ OptionsSize changed from .b To .a \ OptionsData changed from .l To .i MSG corrected alignment POLYTEXT corrected alignment PAGESETUPDLG corrected alignment REOBJECT corrected alignment SHFILEINFO corrected alignment For non-unicode mode on x64 MODULEENTRY32 corrected alignment For non-unicode mode on x64 PROCESSENTRY32 corrected alignment For unicode mode on x64 NMCBEDRAGBEGIN corrected alignment For unicode mode on x64 NMCBEENDEDIT corrected alignment For unicode mode on x64 TBBUTTON added CompilerIf For x64 To correct member bReserved For x64 XMM_SAVE_AREA32 added CompilerIf For x64 And correct members WSADATA added CompilerIf For x64 And correct members SERVENT added CompilerIf For x64 And correct members ;>----------------------------------------------------------------------------------- ;- changed member names ;>----------------------------------------------------------------------------------- ACCEL \ Pad -> PB_Align NETENT \ pad -> PB_Align NEWTEXTMETRIC \ ntmAveWidth -> ntmAvgWidth WIN32_FIND_DATA \ cAlternate -> cAlternateFileName NMTBRESTORE \ nmhdr -> hdr SECURITY_DESCRIPTOR \ lGroup -> Group MEMORY_BASIC_INFORMATION \ lType -> Type EXCEPTION_POINTERS \ pExceptionRecord -> ExceptionRecord CANDIDATELIST \ dwOffset1 -> dwOffset[1] METARECORD \ rdParam1 -> rdParam[1] ENHMETARECORD \ dParam1 -> dParam[1] DDEDATA \ Value1 -> Value[1] DDEPOKE \ Value1 -> Value[1] DDEUP \ xRGB1 -> rgb[1] DDEML_MSG_HOOK_DATA \ Data.l -> Data.l[8] And corrected alignment EMRPOLYBEZIERTO16 \ apts.POINT[1] -> apts.POINTS[1] METAFILEPICT \ imm -> mm EMRGDICOMMENT \ xData -> Data EMRSCALEVIEWPORTEXTEX \ yDemon -> yDenom EMRSCALEWINDOWEXTEX \ yDemon -> yDenom EMRCREATEDIBPATTERNBRUSHPT \ ihBursh -> ihBrush CHARSETINFO \ xlfs -> fs MCI_GETDEVCAPS_PARMS \ dwIten -> dwItem JOB_INFO_2 \ iSize -> Size FORM_INFO_1 \ isize -> Size NAME_BUFFER \ xname -> name PERF_DATA_BLOCK \ PerTime100nSec -> PerfTime100nSec TVITEMEX \ integral -> iIntegral PARAFORMAT \ wReserved -> wEffects CHOOSEFONT \ Alignment -> ___MISSING_ALIGNMENT___ TC_ITEM \ lpReserved1 -> dwState \ lpReserved2 -> dwStateMask WIN32_STREAM_ID \ dwStreamSizeLow -> Size.LARGE_INTEGER \ dwStreamSizeHigh -> also in Size IMAGE_EXPORT_DIRECTORY \ nBase -> Base \ nName -> Name COLORMAP \ cmFrom -> from \ cmTo -> To ADAPTER_STATUS \ max_dgram_isize -> max_dgram_size \ max_sess_pkt_isize -> max_sess_pkt_size DEBUGHOOKINFO \ hModuleHook -> idThread \ Reserved -> idThreadInstaller CRITICAL_SECTION \ changed all member names, they were dummies before USER_INFO_3 \ changed all member names And corrected all types GROUP_INFO_2 \ changed all member names And corrected all types |