AGB  ·  Datenschutz  ·  Impressum  







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

Problem mit NtQueryObject

Ein Thema von Chewie · begonnen am 1. Nov 2003 · letzter Beitrag vom 1. Nov 2003
Antwort Antwort
Chewie

Registriert seit: 10. Jun 2002
Ort: Deidesheim
2.886 Beiträge
 
Turbo Delphi für Win32
 
#1

Problem mit NtQueryObject

  Alt 1. Nov 2003, 13:22
Ich will NtQueryObject aufrufen, bekomme aber eine AccessViolation. Wieso?

So ist NtQueryObject importiert:

Delphi-Quellcode:
const
  ntdll = 'ntdll.dll';

  NTSTATUS = ULONG;
  PVOID = Pointer;
  USHORT = Word;
 
  OBJECT_INFORMATION_CLASS = (ObjectBasicInformation, ObjectNameInformation,
    ObjectTypeInformation, ObjectAllInformation, ObjectDataInformation);
  TObjectInformationClass = OBJECT_INFORMATION_CLASS;


function NtQueryObject(
  ObjectHandle: THandle;
  ObjectInformationClas: TObjectInformationClass;
  out ObjectInformation: PVOID;
  ObjectInformationLength: ULONG;
  out ReturnLength: PULONG): NTSTATUS; stdcall; external ntdll name 'NtQueryObject';
So rufe ich es auf:
Delphi-Quellcode:
var
  ObjectInformation: Pointer;
  ReturnLength: PULONG;
  hMutex: THandle;
begin
  hMutex := CreateMutex(nil, False, 'testmutex');
  if hMutex = 0 then
  begin
    SysErrorMessage(GetLastError);
    Exit;
  end;
  NtQueryObject(hMutex, ObjectNameInformation,
    ObjectInformation, 2048, ReturnLength);
end;
Martin Leim
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
  Mit Zitat antworten Zitat
Assarbad
(Gast)

n/a Beiträge
 
#2

Re: Problem mit NtQueryObject

  Alt 1. Nov 2003, 16:24
Also erstmal:

{$MINENUMSIZE 4} Tcha und dann müßte ich näher drauf schauen ... hab aber bis Freitag kommender Woche keine Zeot für solche Kapriolen. Wenn bis dahin keine Lösung existiert, schreib mir ne kurze Mail.
  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 22:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz