![]() |
Re: [Delphi] ASM => applicationdata
0_o omg klappt das echt??? xDDD
ich probiers mal scherzeshalber aus...hatte da garnicht dran gedacht^^ da o0o |
Re: [Delphi] ASM => applicationdata
Zitat:
|
Re: [Delphi] ASM => applicationdata
Weil du es bist:
Delphi-Quellcode:
Allgemein ist test Register, Register besser als cmp Register, 0, da es in 2 statt 3 Bytes codiert wird. Außerdem ist bei GMEM_FIXED bzw. GPTR kein GlobalLock notwendig.
function GetShellFolder(CSIDL: Integer): PChar;
asm push eax //das ist die Variable PIDL push esp push eax push 0 call SHGetSpecialFolderLocation test eax, eax jnz @@ExitProc push MAX_PATH push GMEM_FIXED call GlobalAlloc pop edx push eax push eax push edx call SHGetPathFromIDList pop eax @@ExitProc: end; Des Weiteren führt der Code (auch meiner) zu einem Speicherleck: PIDL soll man laut MSDN mit dem IMalloc der Shell freigeben. |
Re: [Delphi] ASM => applicationdata
um sich die Arbeit zu ersparen kann man anstelle von SHGetSpecialFolderLocation auch SHGetSpecialFolderPath verwenden.
|
Re: [Delphi] ASM => applicationdata
Oki Danke dir Apollonius :thumb: Was ich noch nicht verstehe ist wo du Result setzt und wo du CLSID ausließt. Werden die Werte automatisch in die von dir verwendeten Register geschrieben?
|
Re: [Delphi] ASM => applicationdata
Aufrufkonvention Register -> erster Parameter in EAX, zweiter in EDX, dritter in ECX, weitere auf dem Stack, außerdem wird bei allen Aufrufkonventionen außer Safecall der Rückgabewert in EAX gespeichert.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:57 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz