English
Forum

defective documented Windows API? Please test...

 
- Page 1 -


Hello Profaner...

I need under possible all 32BIt Windowssystemen (is not NT4) The Rückgaben from the Editbox for under stehenden View source. it's about The detection one "Fehlers" in the MSDN Documentation. I have already something longer whom suspicion, that there something integrally and none is correct....
CompileMarkSeparation
Def @GetWindowThreadProcessId(2) !"USER32","GetWindowThreadProcessId"
Def @CreateToolhelp32Snapshot(2) !"kernel32","CreateToolhelp32Snapshot"
Def @Heap32ListNext(2) !"kernel32","Heap32ListNext"
Def @Heap32ListFirst(2) !"kernel32","Heap32ListFirst"
Def @Heap32Next(1) !"kernel32","Heap32Next"
Def @Heap32First(3) !"kernel32","Heap32First"
Def @CloseHandle(1) !"KERNEL32","CloseHandle"
Def @GetLastError(0) !"KERNEL32","GetLastError"
Def @GetVersionEx(1) !"KERNEL32","GetVersionExA"
DEF &Ver_Platform_Win32_Windows 1
DEF &Ver_Platform_Win32_NT 2
Declare Fenster&, PROCESSID#, ThreadID&, PROCESSID&, HEAPLIST32#, Result_HL&, hSnapshot&, HeapCount%
Declare HEAPENTRY32#, HeapBlockCount%, Result2&, Zwischenmerker&, Heap_Handle_LIST%, Zwischenmerker$
Declare WinVer&, Winver$, OS#
Struct HEAPLIST32 = LISTdwsize&, Listth32ProcessID&, LISTth32HeapID&, dwLISTFlags&
Struct HEAPENTRY32 = HEdwsize&, hHandle&, dwAddress&, dwBlockSize&, dwFlags&, dwLockCount&, dwResvd&, HEth32ProcessID&, HEth32HeapID&
Struct OSVERSIONINFO = dwOSVersionInfoSize&,dwMajorVersion&,dwMinorVersion&,dwBuildNumber&,dwPlatformId&,szCSDVersion$(128)

Proc ?_GetWinVersion

    Parameters ServicePack%
    Declare ServicePack$
    Windows-Version ermitteln
    DEF &Ver_Platform_Win32_Windows 1
    DEF &Ver_Platform_Win32_NT 2
    Dim OS#,OSVERSIONINFO
    OS#.dwOSVersionInfoSize& = 148
    External("Kernel32","GetVersionExA",OS#)
    LET Winver& = 100
    LET ServicePack$ = " ("+OS#.szCSDVersion$+")"

    If OS#.dwPlatformId& = &Ver_Platform_Win32_Windows

        If OS#.dwMajorVersion& = 4

            Case OS#.dwMinorVersion& = 0  : Winver& = 1
            Case OS#.dwMinorVersion& = 10 : Winver& = 2
            Case OS#.dwMinorVersion& = 90 : Winver& = 3

        Endif

    ElseIf OS#.dwPlatformId& = &Ver_Platform_Win32_NT

        Case OS#.dwMajorVersion& = 3 : Winver& = 4
        Case OS#.dwMajorVersion& = 4 : Winver& = 5

        IF @and(OS#.dwMajorVersion& = 5,OS#.dwMinorVersion& <> 2)

            LET Winver& = 6

        Elseif @and(OS#.dwMajorVersion& = 5,OS#.dwMinorVersion& = 2)

            LET Winver& = 8

        endif

        IF @and(OS#.dwMajorVersion& = 6,OS#.dwMinorVersion& = 0)

            LET Winver& = 9

        endif

        Case OS#.dwMinorVersion& = 1 : Winver& = 7

    Endif

    Dispose OS#
    case WinVer& = 1: Let Winver$ = "Windows95"
    case WinVer& = 2: Let Winver$ = "Windows98"
    case WinVer& = 3: Let Winver$ = "WindowsME"
    case WinVer& = 4: Let Winver$ = "WindowsNT 3.5"
    case WinVer& = 5: Let Winver$ = "WindowesNT 4"
    case WinVer& = 6: Let Winver$ = "Windows2000"
    case WinVer& = 7: Let Winver$ = "WindowsXP"
    case WinVer& = 8: Let Winver$ = "Windows Server 2003"
    case WinVer& = 9: Let Winver$ = "WindowsVista oder Longhorn"
    case WinVer& = 100: Let Winver$ = "unbekannte Windowsversion"
    CASE ServicePack% = 1 : Let Winver$ = Winver$ + ServicePack$

EndProc

@winexec("WRITE.EXE", 1)
Sleep 500
LET Fenster& = @FindWindow("Dokument - ")
DIM PROCESSID#, 4
LET ThreadID& = @GetWindowThreadProcessId(Fenster&, PROCESSID#)
LET PROCESSID& = @Long(PROCESSID#, 0)
Dispose PROCESSID#
Dim HEAPLIST32#, HEAPLIST32
Dim HEAPENTRY32#, HEAPENTRY32
Clear HEAPLIST32#
LET Heap_Handle_LIST% = 1
HEAPLIST32#.LISTdwsize& = 16
LET hSnapshot& = @CreateToolhelp32Snapshot($1, ProcessID&)

IfNot hSnapshot& = -1

    Clearlist
    ?_GetWinVersion 1
    Addstring "Windowsversion: "+Winver$
    LET Result_HL& = @Heap32ListFirst(hSnapshot&, HEAPLIST32#)

    While Result_HL& = 1

        Clear HEAPENTRY32#
        HEAPENTRY32#.HEdwsize& = 36
        INC HeapCount%
        Clear HeapBlockCount%
        Addstring "____________________________"
        LET Result2& = @Heap32First(HEAPENTRY32#, ProcessID&, HEAPLIST32#.Listth32HeapID&)
        LET Zwischenmerker& = HEAPLIST32#.dwLISTFlags&
        Addstring "Daten des "+@STR$(HEAPCOUNT%)+".Heaps"
        Addstring "Heapflags: $"+@HEX$(Zwischenmerker&)

        IF Heap_Handle_LIST% = 1

            IF Result2& = 1

                Addstring "Handle im Prozess: "+@STR$(HEAPENTRY32#.hHandle&)
                Addstring "Toolhelp-ID des Heaps: "+@STR$(HEAPLIST32#.LISTth32HeapID&)

            Else

                Addstring "Handle im Prozess: "+@STR$(HEAPLIST32#.LISTth32HeapID&)

            endif

            IF @or(Zwischenmerker&, $2) = Zwischenmerker&

                Addstring "Speicherstatus: "+"Heap kann wachsen"
                LET Zwischenmerker& = Zwischenmerker&-$2

            else

                Addstring "Speicherstatus: "+"Größe beschränkt"

            Endif

            IF @or(Zwischenmerker&, $1) = Zwischenmerker&

                Addstring "Speicherverwaltung: "+"Kein gleichzeitiger Zugriff mehrerer Threads"
                LET Zwischenmerker& = Zwischenmerker&-$1

            else

                Addstring "Speicherverwaltung: "+"Gleichzeitiger Zugriff mehrerer Threads möglich"

            Endif

            IF @or(Zwischenmerker&, $4) = Zwischenmerker&

                Addstring "Fehlerbehandlung: "+"Meldung einer Zugriffsverletzung bei Fehlern"
                LET Zwischenmerker& = Zwischenmerker&-$4

            else

                Addstring "Fehlerbehandlung: "+"API gibt bei Fehlern 0 zurück"

            Endif

        else

            IF @or(Zwischenmerker&, $1) = Zwischenmerker&

                Addstring "Typ: "+"Standard Prozessheap"
                LET Zwischenmerker& = Zwischenmerker&-$1

            endif

            IF @or(Zwischenmerker&, $2) = Zwischenmerker&

                Addstring "Speicherverwaltung: "+"Shared Heap"
                LET Zwischenmerker& = Zwischenmerker&-$2

            endif

        endif

        IF Zwischenmerker&<>0

            Addstring "Nicht erkannte Heapflags: "+"$"+@Hex$(Zwischenmerker&)

        endif

        While Result2& = 1

            INC HeapBlockCount%
            Addstring ""

            IF Heap_Handle_LIST% = 0

                Addstring @STR$(HEAPCOUNT%)+".Heap "+@Str$(HeapBlockCount%)+".Block Handle im Prozess: "+@STR$(HEAPENTRY32#.hHandle&)
                Addstring @STR$(HEAPCOUNT%)+".Heap "+@Str$(HeapBlockCount%)+".Block Startadresse: "+@STR$(HEAPENTRY32#.dwAddress&)

            Else

                Addstring @STR$(HEAPCOUNT%)+".Heap "+@Str$(HeapBlockCount%)+".Block Startadresse: "+@STR$(HEAPENTRY32#.dwAddress&)

            endif

            Let Zwischenmerker$ = " ("

            IF HEAPENTRY32#.dwFlags& = $1

                LET Zwischenmerker$ = Zwischenmerker$+"feste Adresse"

            ElseIf HEAPENTRY32#.dwFlags& = $2

                LET Zwischenmerker$ = Zwischenmerker$+"frei"

            ElseIf HEAPENTRY32#.dwFlags& = $4

                LET Zwischenmerker$ = Zwischenmerker$+"beweglich"

            Else

                LET Zwischenmerker$ = Zwischenmerker$+"$"+@HEX$(HEAPENTRY32#.dwFlags&)

            endif

            Let Zwischenmerker$ = Zwischenmerker$+")"
            Addstring @STR$(HEAPCOUNT%)+".Heap "+@Str$(HeapBlockCount%)+".Block Größe / Status: "+@STR$(HEAPENTRY32#.dwBlockSize&)+" Bytes"+Zwischenmerker$
            LET Result2& = @Heap32Next(HEAPENTRY32#)

        wend

        LET Result_HL& = @Heap32ListNext(hSnapshot&, HEAPLIST32#)

    wend

    @CloseHandle(hSnapshot&)

endif

Dispose HEAPLIST32#
Editbox("Infos over Heaps of Wordpad", 1)

and for all The, The whom code so not testing can, here The EXE to that Download:
[...] 
 
02/16/07  
 



 
- Page 1 -


the my I do not, it's about the lever the Heapblocks. Wordpad must incidentally open stay, To The Editbox comes.
 
02/16/07  
 




Nico
Madysa
Bitteschön, here my Result:

38 kB
Hochgeladen:02/16/07
Downloadcounter66
Download
 
Nico Madysa
02/16/07  
 



where are you because? straight The need I yet!
 
02/16/07  
 



thanks Nico, supposition shining (if I me not somewhere utterly verhaspelt have ) confirm.
 
02/16/07  
 




Nico
Madysa
Freut me for you. I Have from the stuff namely nothing understands.
 
Nico Madysa
02/16/07  
 



 
- Page 2 -


make a long story short: Microsoft shining NT Systemen something in the API changed to have and verschweigt apparently these Änderung since windows2000. These Änderung concerns The Toolhelp Structures HEAPLIST32 and HEAPENTRY32, The from the APIs Heap32ListFirst, Heap32ListNext Heap32First and Heap32Next used go. Richtet one itself to the Documentation, get one incorrect values. cool, or?

has someone against my Feststellung something einzuwenden?
 
02/16/07  
 




Nico
Madysa

cool, or?


in the Hinblick hereon, that these Feststellung evident ironical meant is, Have I nothing against it einzuwenden.
 
Nico Madysa
02/16/07  
 



I have me straight The kompletten Rückmeldungen of Vista (thanks Rolf) respected. Chaotik without equal - and that with of/ one dokumentierten API!
who somehow on Loghorn / 2003 comes - too of it had I gladly The kompletten Rückmeldungen the Quelltextes!

How should one because programs write, if Microsoft dokumentiertes behaviour of/ one API ongoing changes?
(detail item moreover on of my Homepage [...] )
 
02/17/07  
 



You should ebend The SDKs using.
 
02/17/07  
 



what standing there very to the Structures? is The Statement there rather?
 
02/17/07  
 



iF
You should ebend The SDKs using.


Sorry, I over again demand: How very sees The Statement the Structures HEAPLIST32 and HEAPENTRY32 in the SDK To windows2000 or XP from? there MSDN your Documentation apparently to the attend of Vista adjusted has, I'm going in the moment of it from, that there nothing other standing.
 
02/17/07  
 



we talk together past - have strain one blöderes The problem Codeanzeige the Nity is mci ...
 
02/17/07  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.743 Views

Untitledvor 0 min.
Michael Uckermann08/19/14
Andreas Koch06/13/12

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie