AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Small library for Alternative Data Streams (ADS)

Ein Thema von Kas Ob. · begonnen am 21. Aug 2024 · letzter Beitrag vom 21. Aug 2024
Antwort Antwort
Benutzerbild von dummzeuch
dummzeuch

Registriert seit: 11. Aug 2012
Ort: Essen
1.687 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#1

AW: Small library for Alternative Data Streams (ADS)

  Alt 21. Aug 2024, 11:21
Thanks. Interesting.

Could you please edit your post and replace the code tags with Delphi tags, so we get syntax highlighting?

Code:
procedure bla;
begin
end;
vs.
Delphi-Quellcode:
procedure bla;
begin
end;
Thomas Mueller

Geändert von dummzeuch (21. Aug 2024 um 17:55 Uhr)
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
412 Beiträge
 
#2

AW: Small library for Alternative Data Streams (ADS)

  Alt 21. Aug 2024, 11:26
could you please edit your post and replace the code tags with Delphi tags, so we get syntax highlighting?
Thank you, i never saw that button
Kas
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.659 Beiträge
 
Delphi 12 Athens
 
#3

AW: Small library for Alternative Data Streams (ADS)

  Alt 21. Aug 2024, 12:46
Passing a TStringList as Var-Parameter does not make sense in this context. The underlying instance has to be created and destroyed from outside, so you can even pass it as Const-Parameter.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
412 Beiträge
 
#4

AW: Small library for Alternative Data Streams (ADS)

  Alt 21. Aug 2024, 12:58
Passing a TStringList as Var-Parameter does not make sense in this context. The underlying instance has to be created and destroyed from outside, so you can even pass it as Const-Parameter.
Right and makes sense, only i prefer this usage (const vs var) with classes to distinguish between functions/procedures that read-only against what might change the content, so yes it is just cosmetic, like with this case and that example, but will makes difference with multithreads usage, easier to notice and remember and that is it, where and when need thread synchronization.

Also: we only can dream of compiler and more advanced Delphi/Pascal language feature to detect and prevent internal changes coming form class internal implementation, that makes const and var more powerful, producing safer memory and logical handling.
Kas
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.379 Beiträge
 
Delphi 12 Athens
 
#5

AW: Small library for Alternative Data Streams (ADS)

  Alt 21. Aug 2024, 12:48
Die BackupAPI, und dafür die nötigen Rechte, ist garnicht nötig. (Administrator oder ein Nutzer mit Backup&Restore-Privilegien aka SE_BACKUP_NAME)
Seit Vista gibt es auch eine neue API dafür. MSDN-Library durchsuchenFindFirstStreamW.

https://learn.microsoft.com/de-de/wi...ndfirststreamw
https://learn.microsoft.com/en-us/ar...g-ntfs-streams
https://www.codeproject.com/Articles...e-Data-Streams

https://learn.microsoft.com/en-us/wi...o/file-streams



Mußt du dir aber selbt im Delphi implementieren, da die API-Imports im Delphi viel zu alt sind. (Winapi.Windows.pas)

Aber mit etwas Glück, kannst du diesen Teil vielleicht aus dem WinMD nutzen,
auch wenn zu viel Anderes einfach nur Schrott ist. (WinMD selbst ist OK, aber nicht das was Embarcadero daraus gemacht hat)
https://getitnow.embarcadero.com/win...pi-from-winmd/
https://www.delphipraxis.net/214473-...vor-winmd.html



PS: Length(StreamArr) - 1 = High(StreamArr)
Ein Therapeut entspricht 1024 Gigapeut.

Geändert von himitsu (21. Aug 2024 um 12:59 Uhr)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:14 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