Calling Windows Builtin Functions Using External Procedures Fails With ORA-28576 (Doc ID 217451.1)

Last updated on JUNE 19, 2017

Applies to:

PL/SQL - Version 9.0.1.0 and later
Microsoft Windows (32-bit)

Goal

Beginning with Oracle 9iR1 (9.0.1.X) RDBMS and higher on Windows Platform you may get an

ORA-28576: Lost RPC connection to external procedure agent


if you try to call functions from a DLL by using EXTPROC.

The cause of the Problem is the definition of the calling convention of the library function. If the convention

__cdecl


is used (Compiler Option /Gd), the library function can be called without raising ORA-28576 - but if the convention

__stdcall


is used (Compiler Option /Gz), then the ORA-28576 is raised.

To overcome this limitation a sort of "intermediate dll" which will be called by EXTPROC and loads the target library and executes the desired function. For every function used in combination with EXTPROC and declared as __stdcall there has to be a counterpart in the "intermediate dll"

Solution

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms