Einzelnen Beitrag anzeigen

Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#13

Re: [Delphi] ASM => applicationdata

  Alt 6. Mär 2008, 17:10
Ich glaube er will in allen möglichen Sprachen den Windows Pfad und den AppData Pfad ermitteln .. daher möchte er auch Assembler verwenden. Warum inline Assembler und nicht direkt MASM32 weiß ich auch nicht .. hab mal bisschen rumgewerkelt, aber die auskommentierten Zeilen bekomme ich in inline Assembler nicht hin:

Delphi-Quellcode:
function GetShellFolder(CSIDL: Integer): string;
var
  pidl: PItemIdList;
  FolderPath: String;
  SystemFolder: Integer;
begin
  asm
    mov eax, CSIDL
    mov SystemFolder, eax
    lea eax, pidl
    push eax
    push SystemFolder
    push 0
    call SHGetSpecialFolderLocation
    push eax
    call SUCCEEDED
    cmp eax, 0
    je @@ExitProc
    // SetLength(FolderPath, MAX_PATH)
    push FolderPath
    push pidl
    call SHGetPathFromIDList
    cmp eax, 0
    je @@ExitProc
    // SetLength(FolderPath, Length(PChar(FolderPath))
    // Result := FolderPath
    @@ExitProc:
  end;
end;
Ansonsten funktioniert es ..
  Mit Zitat antworten Zitat