Einzelnen Beitrag anzeigen

Benutzerbild von Dalai
Dalai

Registriert seit: 9. Apr 2006
1.680 Beiträge
 
Delphi 5 Professional
 
#2

AW: TSHFileOpStruct - Wieviele Null-Terminatoren braucht der Mensch?

  Alt 1. Jan 2020, 21:36
Eigentlich steht alles in dem verlinkten MS-Artikel drin:
Zitat:
pFrom

Type: PCZZTSTR

[...]
Although this member is declared as a single null-terminated string, it is actually a buffer that can hold multiple null-delimited file names. Each file name is terminated by a single NULL character. The last file name is terminated with a double NULL character ("\0\0") to indicate the end of the buffer.
Damit die API-Funktion weiß, wo das Ende des Buffers ist, sind zwei NULLs nötig.

Im Delphi würde ich das wohl so machen: PChar(szSource + #0); denn IIRC hängt der Cast zu PChar bereits ein NULL an.

Grüße
Dalai
  Mit Zitat antworten Zitat