AGB  ·  Datenschutz  ·  Impressum  







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

File handle readonly?

Ein Thema von Neutral General · begonnen am 3. Jun 2008 · letzter Beitrag vom 3. Jun 2008
 
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#3

Re: File handle readonly?

  Alt 3. Jun 2008, 18:22
Hi Apollonius,

Diese Funktion scheint die richtige zu sein, aber ich musste sie mir selbst importieren und entweder hat das nicht so ganz funktioniert oder ich rufe die Funktion falsch auf.

(ist jetzt alles nur mal dahingeklatscht

Delphi-Quellcode:
interface

type
  OBJECT_INFORMATION_CLASS = (ObjectBasicInformation,
                              ObjectNameInformation,
                              ObjectTypeInformation,
                              ObjectAllInformation,
                              ObjectDataInformation);

   PObjectBasicInformation = ^TObjectBasicInformation;
   TObjectBasicInformation = packed record
     Attributes: Cardinal;
     GrantedAccess: ACCESS_MASK;
     HandleCount: Cardinal;
     PointerCount: Cardinal;
     Reserved: Array[0..9] of Cardinal;
   end;

   function NtQueryObject(Handle: THandle;
                          ObjectInformationClass: OBJECT_INFORMATION_CLASS;
                          out ObjectInformation: Pointer;
                          ObjectInformationLength: ULONG;
                          out ReturnLength: PULONG): Cardinal; external 'ntdll.dll';
Aufruf:

Delphi-Quellcode:
var inf: Pointer;
    size: ULONG;
      l : PULONG;
begin
  size := SizeOf(TObjectBasicInformation);
  NtQueryObject(FileHandle,ObjectBasicInformation,inf,size,l);
end;
Habe auch schon gegoogelt und in der DP gesucht, aber nichts gefunden was mir geholfen hätte. Hab herausgefunden das die Aufrufkonvention "NTAPI" ist?!

Zitat:
NTSTATUS NTAPI NtQueryObject (
IN HANDLE ObjectHandle,
IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
OUT PVOID ObjectInformation,
IN ULONG ObjectInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
Ich weiß grad einfach nicht weiter... Bin überfordert
Michael
  Mit Zitat antworten Zitat
 


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 21: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