News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM32 Version 9 Release

Started by hutch--, March 09, 2006, 03:13:36 AM

Previous topic - Next topic

key2k3

I've just installed MASMv9 and tried to build my projects. There is
a mismatch of the QUOTA_LIMITS struct between your windows.inc
and EliCZ's NtStruc.inc ... EliCZ defines it as follows:


     QUOTA_LIMITS  STRUCT   ;NTDDK corrected by EliCZ: size must be 20H
      PagedPoolLimit         DWORD ?
      NonPagedPoolLimit      DWORD ?
      MinimumWorkingSetSize  DWORD ?
      MaximumWorkingSetSize  DWORD ?
      PagefileLimit          DWORD ?
      Reserved14             DWORD ?   ;added (probably qword alignment)
      TimeLimit              QWORD ?
     QUOTA_LIMITS  ENDS


While windows.inc defines it as:


     QUOTA_LIMITS STRUCT
       PagedPoolLimit  DWORD ?
       NonPagedPoolLimit DWORD ?
       MinimumWorkingSetSize DWORD ?
       MaximumWorkingSetSize DWORD ?
       PagefileLimit   DWORD ?
       TimeLimit       LARGE_INTEGER <>
     QUOTA_LIMITS ENDS


Apart from that, it works.

Regards,
- key2k3 -

hutch--

This is what my PLATFORMSDK has.


typedef struct _QUOTA_LIMITS {
  SIZE_T PagedPoolLimit;
  SIZE_T NonPagedPoolLimit;
  SIZE_T MinimumWorkingSetSize;
  SIZE_T MaximumWorkingSetSize;
  SIZE_T PagefileLimit;
  LARGE_INTEGER TimeLimit;
} QUOTA_LIMITS;
typedef QUOTA_LIMITS *PQUOTA_LIMITS;


The ersion in WINDOWS.INC is correct by this definition.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

hitchhikr

I'm using the masm32 distribution.

ramguru

hutch,
what am I doing wrong?

        @duplicate:
        ...
        ; len == 1
        ; case 1 - JUMP IS TAKEN
mov    al, BYTE PTR [esi]
mov    cl, BYTE PTR [edi]
cmp    al, cl
jz     @duplicate
        ; case 2 - JUMP IS NOT TAKEN
invoke cmpmem,  esi, edi, len
jnz    @duplicate


Maybe the problem is because len is usually one byte, but can be greater ?..

ramguru

I made a little test, which required me to write comparison routine (at least experiment was worth something)...
so I was comparing two equal 15byte data buffers, everything was very simple I called each comparison routine 15 times with different length, from 15 to 1, and here ar the results..
111111111111000 - cmpmem...
111111111111111 - my_slow_compare

so it's obvious that cmpmem requires at least 4 bytes data length


my_slow_compare proc uses esi edi src:DWORD, dst:DWORD, len:DWORD

mov    esi, src
mov    edi, dst
mov    ecx, len

@@:
mov    al, BYTE PTR [esi]
mov    dl, BYTE PTR [edi]
cmp    al, dl
jnz    @no_match
dec    ecx
test   ecx, ecx
jz     @match
inc    esi
inc    edi
jmp    @B
@match:
mov    eax, 1
ret
@no_match:
mov    eax, 0
ret

my_slow_compare endp

hutch--

ramguru,

Thanks for doing the test, as soon as I get time I will have a good look at the cmpmem algo. Here is a byte version that should have some reasonable legs, it will not be as fast as a DWORD compare version but it is alignment insensitive and seems to run OK.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

comment * -----------------------------------------------------
                        Build this  template with
                       "CONSOLE ASSEMBLE AND LINK"
        ----------------------------------------------------- *

    byte_compare PROTO :DWORD, :DWORD, :DWORD

    .data
      item1 db "1111111111111111"
      item2 db "1111111111111111"

    .code

start:
   
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    call main
    inkey
    exit

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

main proc

    LOCAL bcnt :DWORD

    mov bcnt, 16

  @@:
    invoke byte_compare,ADDR item1,ADDR item2,bcnt
    print str$(eax),13,10
    sub bcnt, 1
    jnz @B

    ret

main endp

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

OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

align 16

byte_compare proc src:DWORD, dst:DWORD, ln:DWORD

    push esi
    push edi

    mov esi, [esp+4+8]  ; src
    mov edi, [esp+8+8]  ; dst
    mov ecx, [esp+12+8] ; ln
    mov edx, -1

    push ebp
    mov ebp, 1

  @@:
    add edx, ebp
    movzx eax, BYTE PTR [esi+edx]
    cmp al, BYTE PTR [edi+edx]
    jnz no_match
    sub ecx, ebp
    jnz @B

  match:
    mov eax, ebp
    pop ebp
    pop edi
    pop esi
    ret 12

  no_match:
    xor eax, eax
    pop ebp
    pop edi
    pop esi
    ret 12

byte_compare endp

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

milligator

i could not install it
i have recieved an error
7z SFX has encountered a problem and needs to close

AppName: finst.exe    AppVer: 4.23.0.0    ModName: unknown
ModVer: 0.0.0.0    Offset: f60026ab

wht to do noW??

hutch--

If ypou are running a late version of Windows disable DEP as version 9.0 was produced before Microsoft changed the specs for PE files. The problem will be solved in the next version.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

milligator


hutch--

Sp2 introduced the problem. Just turn it OFF and it should install properly.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

milligator

the problem did not solve.should i have instaledl something else such as vs2005 before installing masm32?

hutch--

No, as this is a problem that has been occurring since Microsoft changed the PE specifications, make sure you actually succeed in turning DEP OFF. The SP2 you are using with XP is the problem as it introduced DEP for XP.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

GregL

milligator,

Here is a link about disabling DEP that might help.


milligator

thanks for your help.but i did theese all and the problem is un solved;
1. Click Start
2. Select Control Panel
3. Select System
4. Click the Advanced tab
5. In the Performance region select Settings
6. Click the Data Execute tab in the dialog box that opens
7. Select Turn on DEP for all programs and services except for those I select
8. Click Add.
9. The open dialog box will open. Browse and select your application.
10. Click Open
11. Click Apply
12. Click Ok
13. Reboot

GregL

millifgator,

I think the best option in this case is to "Turn on DEP for essential Windows programs and services only".

These steps are for XP SP2.

1.   Click Start
2.   Settings
3.   Select Control Panel
4.   Select System
5.   Click the Advanced tab
6.   In the Performance region, click Settings
7.   Click the "Data Execution Prevention" tab in the dialog box that opens
8.   Select "Turn on DEP for essential Windows programs and services only"
9.   Click OK
10. Click OK