Browse Source

+ Added constants and types for Delphi compatibility

michael 25 years ago
parent
commit
54f9bbd99b
3 changed files with 120 additions and 5 deletions
  1. 9 1
      rtl/inc/systemh.inc
  2. 42 2
      rtl/win32/wininc/defines.inc
  3. 69 2
      rtl/win32/wininc/struct.inc

+ 9 - 1
rtl/inc/systemh.inc

@@ -79,6 +79,11 @@ Type
 { Zero - terminated strings }
   PChar       = ^Char;
   PPChar      = ^PChar;
+{ Delphi types }  
+  TAnsiChar   = Char;
+  AnsiChar    = TAnsiChar;
+  PAnsiChar   = PChar;
+  
 {$ifdef HASWIDECHAR}
   PWideChar   = ^WideChar;
 {$endif HASWIDECHAR}
@@ -428,7 +433,10 @@ const
 
 {
   $Log$
-  Revision 1.78  2000-02-09 16:59:31  peter
+  Revision 1.79  2000-03-14 10:20:18  michael
+  + Added constants and types for Delphi compatibility
+
+  Revision 1.78  2000/02/09 16:59:31  peter
     * truncated log
 
   Revision 1.77  2000/02/06 17:19:22  peter

+ 42 - 2
rtl/win32/wininc/defines.inc

@@ -2031,6 +2031,7 @@ unit defines;
      ILD_TRANSPARENT = 1;
      CLR_NONE = $ffffffff;
      CLR_DEFAULT = $ff000000;
+     CLR_INVALID = $FFFFFFFF;
   { ImageList_LoadImage  }
      {LR_DEFAULTCOLOR = 0;already above }
      LR_LOADFROMFILE = 16;
@@ -5113,6 +5114,42 @@ unit defines;
   { nt_signature field  }
      IMAGE_NT_SIGNATURE = $4550;
 
+
+  { Severity values }
+    SEVERITY_SUCCESS = 0;
+    SEVERITY_ERROR = 1;
+          
+ { Variant type codes (wtypes.h).
+    Some, not all though }
+    VT_EMPTY           = 0;
+    VT_NULL            = 1;
+    VT_I2              = 2;
+    VT_I4              = 3;
+    VT_R4              = 4;
+    VT_R8              = 5;
+    VT_BSTR            = 8;
+    VT_ERROR           = 10;
+    VT_BOOL            = 11;
+    VT_UI1             = 17;
+    VT_BYREF        = $4000;
+    VT_RESERVED     = $8000;
+
+{ Define the facility codes }
+
+const
+  FACILITY_WINDOWS                     = 8;
+  FACILITY_STORAGE                     = 3;
+  FACILITY_RPC                         = 1;
+  FACILITY_SSPI                        = 9;
+  FACILITY_WIN32                       = 7;
+  FACILITY_CONTROL                     = 10;
+  FACILITY_NULL                        = 0;
+  FACILITY_INTERNET                    = 12;
+  FACILITY_ITF                         = 4;
+  FACILITY_DISPATCH                    = 2;
+  FACILITY_CERT                        = 11;
+
+
 {$endif read_interface}
 
 
@@ -5718,7 +5755,10 @@ end.
 {$endif not windows_include_files}
 {
   $Log$
-  Revision 1.4  2000-02-09 16:59:35  peter
+  Revision 1.5  2000-03-14 10:20:19  michael
+  + Added constants and types for Delphi compatibility
+
+  Revision 1.4  2000/02/09 16:59:35  peter
     * truncated log
 
   Revision 1.3  2000/01/07 16:41:54  daniel
@@ -5730,4 +5770,4 @@ end.
   Revision 1.1  1999/09/16 13:38:22  peter
     * windows unit include moved to wininc/
 
-}
+}

+ 69 - 2
rtl/win32/wininc/struct.inc

@@ -406,6 +406,14 @@ unit struct;
      TBITMAPV4HEADER = BITMAPV4HEADER;
      PBITMAPV4HEADER = ^BITMAPV4HEADER;
 
+     BITMAPFILEHEADER = packed record
+       bfType : Word;
+       bfSize : DWord;
+       bfReserved1 : Word;
+       bfReserved2 : Word;
+       bfOffBits : DWord;
+     end;
+
      BLOB = record
           cbSize : ULONG;
           pBlobData : ^BYTE;
@@ -507,6 +515,12 @@ unit struct;
      TPOINTL = POINTL;
      PPOINTL = ^POINTL;
 
+     TSmallPoint = record
+       X,
+       Y : SmallInt;
+       end;
+       
+
      POINTS = record
           x : SHORT;
           y : SHORT;
@@ -6449,6 +6463,56 @@ unit struct;
      TIMAGEDOSHEADER = IMAGE_DOS_HEADER;
      PIMAGEDOSHEADER = ^IMAGE_DOS_HEADER;
 
+  { Variant support }
+  
+  TVarType = Word;
+  PVariant = ^TVariant;
+
+{ This variant type definition doesn't contain _all_ possible variant
+  types - some are not possible atm with FPC, e.g. VT_BSTR to mention
+  This is part of the variant definition used by Windows API not that Borland
+  TVarRec one which is already partially implemented.
+  Needed for some COM objects }
+  
+  TVariant = record
+    vt: TVarType;
+    wReserved1: Word;
+    wReserved2: Word;
+    wReserved3: Word;
+    case Integer of
+      VT_UI1:                  (bVal: Byte);
+      VT_I2:                   (iVal: Smallint);
+      VT_I4:                   (lVal: Longint);
+      VT_R4:                   (fltVal: Single);
+      VT_R8:                   (dblVal: Double);
+      VT_BOOL:                 (vbool: WordBool);
+      VT_ERROR:                (scode: HResult);
+      VT_BYREF or VT_UI1:      (pbVal: ^Byte);
+      VT_BYREF or VT_I2:       (piVal: ^Smallint);
+      VT_BYREF or VT_I4:       (plVal: ^Longint);
+      VT_BYREF or VT_R4:       (pfltVal: ^Single);
+      VT_BYREF or VT_R8:       (pdblVal: ^Double);
+      VT_BYREF or VT_BOOL:     (pbool: ^WordBool);
+      VT_BYREF or VT_ERROR:    (pscode: ^HResult);
+      VT_BYREF:                (byRef: Pointer);
+  end;
+
+ VARIANT = TVariant;
+
+ MMRESULT = Longint;
+
+type
+  PWaveFormatEx = ^TWaveFormatEx;
+  TWaveFormatEx = packed record
+    wFormatTag: Word;       { format type }
+    nChannels: Word;        { number of channels (i.e. mono, stereo, etc.) }
+    nSamplesPerSec: DWORD;  { sample rate }
+    nAvgBytesPerSec: DWORD; { for buffer estimation }
+    nBlockAlign: Word;      { block size of data }
+    wBitsPerSample: Word;   { number of bits per sample of mono data }
+    cbSize: Word;           { the count in bytes of the size of }
+  end;
+
 {$endif read_interface}
 
 
@@ -6927,7 +6991,10 @@ end.
 {$endif not windows_include_files}
 {
   $Log$
-  Revision 1.4  2000-02-09 16:59:36  peter
+  Revision 1.5  2000-03-14 10:20:18  michael
+  + Added constants and types for Delphi compatibility
+
+  Revision 1.4  2000/02/09 16:59:36  peter
     * truncated log
 
   Revision 1.3  2000/01/07 16:41:56  daniel
@@ -6939,4 +7006,4 @@ end.
   Revision 1.1  1999/09/16 13:38:24  peter
     * windows unit include moved to wininc/
 
-}
+}