with System; with Interfaces.C; package Adadll is ------------------------------ -- Win32 Type Definitions -- ------------------------------ subtype BOOL is Interfaces.C.int; subtype ULONG is Interfaces.C.unsigned_long; subtype LPVOID is System.Address; subtype HINSTANCE is System.Address; -------------------------- -- DLL Initialization -- -------------------------- function DllMain (hInst : HINSTANCE; Reason : ULONG; Reserved : LPVOID) return BOOL; -- DLL management ------------------- -- Subprograms -- ------------------- procedure Junk; -- just tell 'm we're there function Junk_2 return Interfaces.C.int; -- display message and return the answer to everything function Junk_3 (Value : Interfaces.C.int) return Interfaces.C.int; -- display the value and return the value 100 private ----------------- -- Constants -- ----------------- True_BOOL : constant BOOL := 1; -- win32 BOOL 'True' value DLL_PROCESS_DETACH : constant ULONG := 0; DLL_PROCESS_ATTACH : constant ULONG := 1; -- reasons for calling DllMain --------------------------- -- Export Declarations -- --------------------------- pragma Export (StdCall, DllMain, "DllMain"); -- DllMain always uses the StdCall convention pragma Export (C, Junk, "Junk"); pragma Export (C, Junk_2, "Junk_2"); pragma Export (C, Junk_3, "Junk_3"); -- our own stuff uses the C convention --------------------------- -- Import Declarations -- --------------------------- procedure AdaInit; pragma Import (C, AdaInit, "adainit"); -- initialize Ada runtime library procedure AdaFinal; pragma Import (C, AdaFinal, "adafinal"); -- finalize Ada runtime library end Adadll;