Autor Beitrag
Boldar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Do 18.09.08 18:45 
Hallo Leute,
was sind die entsprechungen folgender (C-) Typen in delphi?
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
PLARGE_INTEGER
ULONG
PVOID
PIO_STATUS_BLOCK
POBJECT_ATTRIBUTES
NTSTATUS

Die letzten Beiden sind vermutlich pointer, ebenso PLarge_integer, aber worauf?

Was ist in delphi ein Large integer? int64? und ist Ulong dann cardinal?
Und Was ist Pvoid??
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 18.09.08 19:24 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
  PLARGE_INTEGER = ^LARGE_INTEGER;
  ULONG = Cardinal;

  PVOID = Pointer;

  TObjectAttributes = packed record 
    Length: ULONG; 
    RootDirectory: THandle; 
    ObjectName: PUNICODE_STRING; 
    Attributes: ULONG; 
    SecurityDescriptor: PVOID;        // Points to type SECURITY_DESCRIPTOR 
    SecurityQualityOfService: PVOID;  // Points to type SECURITY_QUALITY_OF_SERVICE 
  end
  OBJECT_ATTRIBUTES = TObjectAttributes; 
  POBJECT_ATTRIBUTES = ^OBJECT_ATTRIBUTES; 

  NTSTATUS = Longint;

  PIO_STATUS_BLOCK = ^IO_STATUS_BLOCK; 
  IO_STATUS_BLOCK = packed record 
    Status: NTSTATUS; 
    Information: DWORD; 
  end;
ULONG ist bei mir auch so definiert in Delphi (2006).
www.delphipraxis.net/topic10030.html
www.delphipraxis.net/topic3014.html
Knulli
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 116
Erhaltene Danke: 2

Win2k, Win7, Win10
D5, D2005, D2006, D2007, D10.4.2
BeitragVerfasst: Do 18.09.08 19:29 
PLARGE_INTEGER: PInt64 oder ^Int64
ULONG Cardinal
PVOID Pointer
PIO_STATUS_BLOCK kenn ich nich...Pointer auf IO_STATUS_BLOCK?? = ^IO_STATUS_BLOCK
POBJECT_ATTRIBUTES kenn ich auch nich
NTSTATUS kenn ich auch nich
Boldar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Do 18.09.08 20:54 
Und was ist dann
ausblenden Delphi-Quelltext
1:
Punicode_string					


ist das dann so etwas in C?
ausblenden Quelltext
1:
2:
3:
4:
5:
typedef struct _LSA_UNICODE_STRING {
  USHORT Length;
  USHORT MaximumLength;
  PWSTR Buffer;
} LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING;


In Delphi müsste das dann so aussehen:
Aber welchen Typ hat Buffer?? Etwa Widestring??

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
type Tunicodestring = packed record
  length: byte;
  Maximumlength: byte;
  Buffer : ?????;
  end;
type Punicode_string = ^unicode_string;
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 18.09.08 21:05 
PWideChar

_________________
Markus Kinzler.
Boldar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Do 18.09.08 21:18 
Also ist das so korekt? Oder fehlt da noch was? Und ist das mit var und const korrekt?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
type phandle = pointer;
type access_mask = integer;
type
  PLARGE_INTEGER = ^LARGE_INTEGER;
  ULONG = Cardinal;

  PVOID = Pointer;

  TObjectAttributes = packed record
    Length: ULONG;
    RootDirectory: THandle;
    ObjectName: Pwidechar;
    Attributes: ULONG;
    SecurityDescriptor: PVOID;
    SecurityQualityOfService: PVOID;
  end;
  OBJECT_ATTRIBUTES = TObjectAttributes;
  POBJECT_ATTRIBUTES = ^OBJECT_ATTRIBUTES;

  NTSTATUS = Longint;

  PIO_STATUS_BLOCK = ^IO_STATUS_BLOCK;
  IO_STATUS_BLOCK = packed record
    Status: NTSTATUS;
    Information: DWORD;
  end;


function NtCreateFile(
var FileHandle : PHANDLE;
const DesiredAccess: ACCESS_MASK;
const ObjectAttributes : POBJECT_ATTRIBUTES;
var IoStatusBlock : PIO_STATUS_BLOCK;
const AllocationSize : PLARGE_INTEGER ;
const FileAttributes : ULONG ;
const ShareAccess : ULONG;
const CreateDisposition : ULONG;
const CreateOptions : ULONG;
const EaBuffer : PVOID;
const EaLength : ULONG
): NTSTATUS;stdcall;external 'ntdll.dll';
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 18.09.08 21:29 
Schau mal hier weiter unten bei Accepted Solution, da ist die komplette Übersetzung zu der DLL schon fertig^^:
www.experts-exchange...lphi/Q_20285753.html
Boldar Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Do 18.09.08 21:33 
Da isses abba nur in C, nich in Delphi(zumindest bei mir nicht!).
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 18.09.08 23:16 
Dann bist du da nicht eingeloggt.