Revision of the "ready to use sdk heder's files" and of the masm32 samples

Started by ToutEnMasm, August 02, 2011, 08:26:16 AM

Previous topic - Next topic

ToutEnMasm

Hello,
To verify the "ready to use sdk heder's files",i have modified the include files used by the masm32 samples.
You can download this here (16 Mo).
http://luce.yves.pagesperso-orange.fr/sdkrc7.cab
Some modified has been made on the heder's files.Glu ...

Here is the resume of what i have changed in the samples.
*** No one modify changing the code has been made
All modifies have only one goal,used of the "ready to used sdk header"

************* For ALL files -----------------------
Relative path is only used for the masm32 files.Windows sdk header's files,libraries have no path
This allow to change the build environment.

call C:\PROGRA~1\MICROS~1.0\Common7\Tools\vsvars32.bat
SET INCLUDE=\SDKRC7
If the vsvars32.bat isn't in this directory,you can change it
with cherche.


      include translate.inc
      include windows.sdk
      include commctrl.sdk

Each sample have now a build batch

***************** minor changes in sources files ------------
**** OPENFILENAME structure hwndOwner is written with a W upper case in windows.inc

**** Those typedef aren't in the "ready to used sdk header"
Some samples need them
HINSTANCE TYPEDEF DWORD
LPSTR TYPEDEF DWORD
HWND TYPEDEF DWORD
UINT TYPEDEF DWORD
WPARAM TYPEDEF DWORD
LPARAM TYPEDEF DWORD

**** The RtlZeroMemory function had no prototype in the windows SDK
She is defined as follow

#define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length)))
#define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
#define RtlCopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length))
#define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
#define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))

She is replaced by the memset function.This one is in the CRT
I have made a little modify of the sdk,adding it to winnt.sdk,at the right place

***** masm32 declarations of prototypes aren't the same as in the windows SDK.

The parameters are cut in pieces of dwords.
The "ready to used sdk" don't do that.Structures,qwords are passed to masm.
This hs needed some changes in the files below


E:\examples\exampl05\lcd\lcd.asm
CheckForButton   proc    dwX:DWORD, dwY:DWORD ;line 863
   Local point:POINT    ;added lines
   mov eax,dwX
   mov point.x,eax
   mov eax,dwY
   mov point.y,eax

        ;invoke   PtInRect, ADDR ButtonNextTrack, dwX, dwY
   invoke   PtInRect, ADDR ButtonNextTrack,point 
   ;and so on
E:\examples\exampl06\opengl\opengl.asm
;gluPerspective PROTO :QWORD ,:QWORD ,:QWORD ,:QWORD
;invoke   gluPerspective,DWORD PTR Value45Dbl,DWORD PTR Value45Dbl+4,DWORD PTR Value1Dbl,DWORD PTR Value1Dbl+4,DWORD PTR Value3Dbl,DWORD PTR Value3Dbl+4,DWORD PTR Value7Dbl,DWORD PTR Value7Dbl+4
invoke   gluPerspective,Value45Dbl,Value1Dbl,Value3Dbl,Value7Dbl

;gluSphere PROTO :DWORD ,:QWORD ,:DWORD ,:DWORD
invoke   gluSphere,GlSphere,[eax],Parts,Parts ; 435 invoke   gluSphere,GlSphere,[eax],[eax+4],Parts,Parts

***** Constants definitions who have changed there name

E:\examples\exampl06\treedemo\treedemo.asm
test     (NM_TREEVIEW ptr [eax]).action, LVIS_FOCUSED ;TVIS_FOCUSED

****** corrected bad build /SUBSYSTEM , CONSOLE  <---> WINDOWS

E:\examples\exampl05\enumkeys\enum.exe ? console ? ? deux micros ?
E:\examples\exampl05\fastexit\fastexit.exe ? console ?

*******     Bad path
E:\examples\exampl10\dynarray\loadfile\Makeit.bat
;The arrfile$ macro bug if file not found
    mov hArr, arrfile$("\masm32\include\windows.inc") ; mov hArr, arrfile$("windows.inc")

What stay useful in the windows.inc is here
Quote
;needed by DDPROTO
    ArgCount MACRO number
      LOCAL txt
      txt equ <typedef PROTO :DWORD>
        REPEAT number - 1
          txt CATSTR txt,<,:DWORD>
        ENDM
      EXITM <txt>
    ENDM

    pr0  typedef PROTO
    pr1  ArgCount(1)
    pr2  ArgCount(2)
    pr3  ArgCount(3)
    pr4  ArgCount(4)
    pr5  ArgCount(5)
    pr6  ArgCount(6)
    pr7  ArgCount(7)
    pr8  ArgCount(8)
    pr9  ArgCount(9)
    pr10 ArgCount(10)
    pr11 ArgCount(11)
    pr12 ArgCount(12)
    pr13 ArgCount(13)
    pr14 ArgCount(14)
    pr15 ArgCount(15)
    pr16 ArgCount(16)
    pr17 ArgCount(17)
    pr18 ArgCount(18)
    pr19 ArgCount(19)
    pr20 ArgCount(20)
    pr21 ArgCount(21)
    pr22 ArgCount(22)
    pr23 ArgCount(23)
    pr24 ArgCount(24)
    pr25 ArgCount(25)

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««