-(def-foreign-type sql-handle-ptr '(* sql-handle))
-(def-foreign-type string-ptr '(* :unsigned-char))
-(def-type long-ptr-type '(* :long))
+(def-foreign-type sql-handle-ptr (* sql-handle))
+(def-foreign-type string-ptr (* :unsigned-char))
+(def-type long-ptr-type (* #.$ODBC-LONG-TYPE))
+
+;; ODBC3
+(def-function "SQLAllocHandle"
+ ((handle-type :short)
+ (input-handle sql-handle)
+ (*phenv sql-handle-ptr))
+ :module "odbc"
+ :returning :short)