Author Topic: A translator for sdk header files (64 and 32 bits translate)  (Read 29901 times)

LiaoMi

  • Member
  • ****
  • Posts: 925
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #45 on: May 27, 2021, 06:10:46 PM »
Hello,
I made an oversight in the 10.6 version,corrected in the 10.7
I have also eliminates the risk with annotations in structures.

Hi TouEnMasm,

we will test it, thanks for your work  :thumbsup:

P.S.
Did you check knownfolders.h?
http://masm32.com/board/index.php?topic=9282.0

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #46 on: May 28, 2021, 02:01:41 AM »

Thanks for your help,I have made a last change in the code ,The typedef multi-dimensionnal are now translated as strucrure and usable by MASM.
Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #47 on: May 28, 2021, 11:40:37 PM »
 :greensml:
I hope last change this time,Some structures wasn't recognize as there.Corrected.
Corrected thread problem,some files wasn't translate (list of files).
A very few number of files don't want to be translated in a list (threaded) and can be only translated as individual.
Those are
Quote
H:\Program Files\editmasm\ref\outils\translator\windows.phone.restricted.cellular.rcspresence.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\abi\windows.phone.restricted.cellular.videotelephony.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\ndis\version.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\hbapiwmi.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\iscsidef.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\iscsiop.h
I don't know for what on 2000 files those ones don't want to be translate in a thread.


Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #48 on: May 31, 2021, 11:55:00 PM »
Hello,
Hope was lost but not the result.
This one:
Filter the MIDL_PASS Lines
Filter the VC++ structures and made a report in the journal.txt.
Solve the thread problem (Not enough memory)
                                         Three files are still resisting to the translation (group files mod,list) ,they are in asm (kxarm..).
Must stay the usual errors to correct.
* Constants not declared        (version number ,you can use an equate with the first term of the comparison GE)
* redefinitions of symbols  name = aname ....conflicting definitions

Tested on the whole sdk 10.0.19041.0 http://luce.yves.pagesperso-orange.fr/header.htm
Don't be afraid by the needed corrections,one ; to put definitions in comment is very usefull.
Chance is also possible,It's it work at the first time,It's not me but the chance.


« Last Edit: June 03, 2021, 10:55:15 PM by TouEnMasm »
Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #49 on: June 17, 2021, 07:22:30 PM »
Hello,
The c++ use complex rules to give a size at the structures with bitfields ,record for masm.
light explain  are here https://docs.microsoft.com/en-us/cpp/cpp/cpp-bit-fields?view=msvc-160
The 11.3 version of headinc give the correct size for those structures.
http://luce.yves.pagesperso-orange.fr/header.htm
Fa is a musical note to play with CL

LiaoMi

  • Member
  • ****
  • Posts: 925
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #50 on: June 18, 2021, 06:15:34 AM »
Hello,
The c++ use complex rules to give a size at the structures with bitfields ,record for masm.
light explain  are here https://docs.microsoft.com/en-us/cpp/cpp/cpp-bit-fields?view=msvc-160
The 11.3 version of headinc give the correct size for those structures.
http://luce.yves.pagesperso-orange.fr/header.htm

Hi TouEnMasm,

http://luce.yves.pagesperso-orange.fr/editmasm.zip

La page que vous demandez est introuvable.
Mais il y a des solutions :

vérifiez l’adresse de la page
précisez-nous votre demande
Vous avez aussi la possibilité de retourner en page d’accueil.

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #51 on: June 18, 2021, 03:23:34 PM »
Mistake of mine,corrected.
The compressed file can be a zip or a 7z (for various reasons)
Better is to connect to the page http://luce.yves.pagesperso-orange.fr/Editmasm.htm

Fa is a musical note to play with CL

LiaoMi

  • Member
  • ****
  • Posts: 925
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #52 on: June 18, 2021, 07:02:56 PM »
Mistake of mine,corrected.
The compressed file can be a zip or a 7z (for various reasons)
Better is to connect to the page http://luce.yves.pagesperso-orange.fr/Editmasm.htm

The link does not work in any conditions  :sad:

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #53 on: June 18, 2021, 11:22:49 PM »
Direct links http://luce.yves.pagesperso-orange.fr/editmasm.7z
 http://luce.yves.pagesperso-orange.fr/translatorus.zip

I verify if the links works and modify this post if necessary.

The two links works for me,perhaps problem is elsewhere ?
Second tests ,same results ?!!.
Fa is a musical note to play with CL

HSE

  • Member
  • *****
  • Posts: 1766
  • <AMD>< 7-32>
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #54 on: June 18, 2021, 11:49:02 PM »
Just in case, is working  :thumbsup:

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #55 on: June 24, 2021, 11:51:52 PM »
A first translate of the SDK KIT 10.0.19041.0,The very last SDK (2021)
The more comon applications can used it without modifies.
For the others,a few modifies will be needed (Incompatible name,re-definition, ..)
Headinc had been also modify a little to avoid too many corrections.
Too many errors in the file,suspect used of C++ structures not translatable.
http://luce.yves.pagesperso-orange.fr/sdkrc100_KIT_10.0.19041.0.7z

Tracking errors:
Quote
Some files use RESERVED as an EQU ,this generate errors with Structures who use it as local.
The better thing to do is to rename those EQU as you want.They are on those files,made it manually.
H:\sdkrc100\shared\bdatypes.sdk
Nombre de reserved : 1       ;corrected
H:\sdkrc100\um\encdec.sdk
Nombre de reserved : 2       ;corrected
H:\sdkrc100\um\Icm.sdk
Nombre de reserved : 1       ;corrected
H:\sdkrc100\um\minidumpapiset.sdk
Nombre de reserved : 2       ;--------- ReservedStream0 not dangerous
H:\sdkrc100\um\sessdirpublictypes.sdk
Nombre de reserved : 1       ;RESERVED_FOR_LEGACY

The result is a very less number of problems


« Last Edit: June 25, 2021, 03:00:34 AM by TouEnMasm »
Fa is a musical note to play with CL

LiaoMi

  • Member
  • ****
  • Posts: 925
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #56 on: June 25, 2021, 08:09:29 AM »
A first translate of the SDK KIT 10.0.19041.0,The very last SDK (2021)
The more comon applications can used it without modifies.
For the others,a few modifies will be needed (Incompatible name,re-definition, ..)
Headinc had been also modify a little to avoid too many corrections.
Too many errors in the file,suspect used of C++ structures not translatable.
http://luce.yves.pagesperso-orange.fr/sdkrc100_KIT_10.0.19041.0.7z

Tracking errors:
Quote
Some files use RESERVED as an EQU ,this generate errors with Structures who use it as local.
The better thing to do is to rename those EQU as you want.They are on those files,made it manually.
H:\sdkrc100\shared\bdatypes.sdk
Nombre de reserved : 1       ;corrected
H:\sdkrc100\um\encdec.sdk
Nombre de reserved : 2       ;corrected
H:\sdkrc100\um\Icm.sdk
Nombre de reserved : 1       ;corrected
H:\sdkrc100\um\minidumpapiset.sdk
Nombre de reserved : 2       ;--------- ReservedStream0 not dangerous
H:\sdkrc100\um\sessdirpublictypes.sdk
Nombre de reserved : 1       ;RESERVED_FOR_LEGACY

The result is a very less number of problems



Hi TouEnMasm,

I will check on old projects, thanks  :thumbsup:


TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #57 on: July 06, 2021, 12:44:58 AM »
Hello,
major Updates in the 11.8 version.
*** All prototypes have Now a  a defined call (cproto or  stdproto ) defined in the translated32(64).inc.
Those two files  are in the package and must be updated http://luce.yves.pagesperso-orange.fr/translatorus.zip
A new section DEFINE_PROTO in the egales.txt allow the user to change that.
The start of the line give The masm definition defined in the translate32(64).inc ,just after follow The .h defines in the same lines.
*** A new method is in use to filter the argument in the structure,function ,interface ...
The method never failed except when a reference isn't found in the argument.
The Journal.txt show "failed to find Argument FiltrageArgumentPrototype"   .
This happen when the first name of a structure ior union is in used instead of the last.
On 1200 files i have find about ten of them.You need to modify the source header to correct the error.
***** corrected the declare_interface translation and made some modifies for less and less modifies to do.
***** long long,long double  are translated  correctly. If you find other double or triple (they exist) values just say it here.





 
« Last Edit: July 06, 2021, 05:59:21 PM by TouEnMasm »
Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #58 on: July 08, 2021, 12:43:17 AM »
Corrected a mistake that made appear function without declaration of call  wthout the word proto.
The new version verify that the function don't use VARARG if it isn't a C call and made the correction if needed.
You see "XXX Error on call ... VARARG must be C ,corrected " in journal.txt.
You can let things are they are or made a search to find the call declaration and add it in the section DEFINE_PROTO in egales.txt



Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: A translator for sdk header files (64 and 32 bits translate)
« Reply #59 on: July 11, 2021, 06:48:06 PM »

New things added:
* The sdk use an opaque pointer with no structure for reasons only Known by microsoft.
   To solve that and avoid many errors generated I have added an INVISIBLE empty structure where those pointer can use (she is in translateXX.inc).
* structures have two names,the last is the more used but this generate errors when the first is used.
   To solve that i have added a control to only use the last name.All first name disappear in the translation.
* corrected an error who made some incompatible names not replaced

I have tested this version on the bigger files I have found and the result show that things are really more simple to do
Fa is a musical note to play with CL