PL/SQL (MOSC)

MOSC Banner

Calling DLL function, Data Type mapping to BINARY_INTEGER

edited Nov 1, 2010 5:03AM in PL/SQL (MOSC) 13 commentsAnswered
 This is about calling DLL functions in general.
One example:
/*
HANDLE WINAPI CreateFile(
  __in      LPCTSTR lpFileName,
  __in      DWORD dwDesiredAccess,
  __in      DWORD dwShareMode,
  __in_opt  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  __in      DWORD dwCreationDisposition,
  __in      DWORD dwFlagsAndAttributes,
  __in_opt  HANDLE hTemplateFile
);
*/
FUNCTION CreateFileA
(
    psFileName IN VARCHAR2,
    pnDesiredAccess IN BINARY_INTEGER,
    pnShareMode IN BINARY_INTEGER,
    pnSecurityAttributes IN BINARY_INTEGER, -- MUST pass 0 !
    pnCreationDisposition IN BINARY_INTEGER,
    pnFlagsAndAttributes  IN BINARY_INTEGER,
    pnTemplateFile IN BINARY_INTEGER
)
RETURN BINARY_INTEGER
AS LANGUAGE C
LIBRARY KERNEL32_Lib
NAME "CreateFileA"
PARAMETERS
(
    psFileName BY REFERENCE STRING,
    pnDesiredAccess UB4,
    pnShareMode UB4,
    pnSecurityAttributes UB4,
    pnCreationDisposition UB4,
    pnFlagsAndAttributes UB4,
    pnTemplateFile UB4,
    RETURN UB4
);

This is the problem: The data type returned by the DLL func. is a

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center