FFI wrapping Kernel32.dll

PACKAGE BODY RER_UTILITY IS
/* Declare the library and function handles. */
kernel32_lhandle                Ora_Ffi.Libhandletype ;
computernamea_fhandle      Ora_Ffi.Funchandletype ;
/* Create the PL/SQL function that will actually */
/* invoke the foreign function. */
FUNCTION ff_computer_name(
     fhandle IN Ora_Ffi.Funchandletype,
strName IN OUT VARCHAR2,
lenName IN OUT NUMBER)RETURN NUMBER;
PRAGMA interface(C, ff_computer_name, 11265);
/* Create the PL/SQL function that is defined in */
/* the package spec. This function simply */
/* passes along the arguments it receives to */
/* ff_computer_name (defined above), prepending the */
/* foreign function handle to the argument List. */
PROCEDURE rer_computer_name(
     strName OUT VARCHAR2,
     lenName OUT NUMBER)
IS
          errNum     NUMBER;
BEGIN
     errNum := 1;
     MESSAGE('Before' || errNum);          
     errNum := ff_computer_name(computernamea_fhandle, strName, lenName);
MESSAGE('After' || errNum);          
EXCEPTION
     WHEN OTHERS THEN
          MESSAGE('Error: ' || SQLCODE || ' Desc: ' || SQLERRM);
          RAISE;     
END rer_computer_name;
/* Define the body of package RER_UTILITY */
BEGIN
     /* Load the library. */
     kernel32_lhandle := Ora_Ffi.Load_Library('C:\TEMP\', 'kernel32.dll');
     /* Register the foreign function. */
     computernamea_fhandle := Ora_Ffi.Register_Function(kernel32_lhandle, 'GetComputerNameA', Ora_Ffi.PASCAL_STD); -- Ora_Ffi.C_Std
     /* Register the return type. */
     Ora_Ffi.Register_Return(computernamea_fhandle, Ora_Ffi.C_LONG);
     /* Register both parameters of function GetComputerNameA. */
     Ora_Ffi.Register_Parameter(computernamea_fhandle, Ora_Ffi.C_CHAR);
     Ora_Ffi.Register_Parameter(computernamea_fhandle, Ora_Ffi.C_LONG);
EXCEPTION
          WHEN OTHERS THEN
          MESSAGE('Error: ' || SQLCODE || ' Desc: ' || SQLERRM);
          RAISE;
END; /* Package Body RER_UTILITY */
Forms 6i running on a XP Pro box pointing toward an 8i database.
Running the code will kick me out with no error.
Running in debug mode, I get a ORA-304500 error.
Any ideas?
Much thanks!

1. You can use the D2KWUTIL library to get the computer name. There is
the WIN_API_ENVIRONMENT.Get_Computer_Name function there.
2. I believe the following code works too:
---- cut here ----
PACKAGE BODY W IS
kernel32_lhandle Ora_Ffi.Libhandletype;
GetComputerName_fhandle Ora_Ffi.Funchandletype;
FUNCTION ff_GetComputerName(
fhandle Ora_Ffi.Funchandletype,
lbBuffer varchar2,
nSize pls_integer ) RETURN pls_integer;
PRAGMA interface(C, ff_GetComputerName, 11265);
FUNCTION GetComputerName RETURN varchar2 IS
buf varchar2(1000);
nSize pls_integer;
ret pls_integer;
BEGIN
-- You have to initialize the buffer for a received information
-- before you call the WinAPI function
-- Allocates 1000 bytes for the buffer
buf:=RPAD( '*', 1000, '*' );
nSize:=length(buf)-1;
ret:=ff_GetComputerName( GetComputerName_fhandle, buf, nSize );
if ret=0 then
-- If the function fails, the return value is zero.
return NULL;
end if;
return substr( buf, 1, nSize );
END;
PROCEDURE Init IS
BEGIN
-- Load the library.
kernel32_lhandle := Ora_Ffi.Load_Library( '', 'kernel32.dll' );     
-- BOOL GetComputerName(
-- LPTSTR lpBuffer, // address of name buffer
-- LPDWORD nSize // address of size of name buffer
GetComputerName_fhandle := Ora_Ffi.Register_Function(
kernel32_lhandle,
'GetComputerNameA',
Ora_Ffi.C_Std );
Ora_Ffi.Register_Parameter( GetComputerName_fhandle, Ora_Ffi.C_CHAR_PTR );
Ora_Ffi.Register_Parameter( GetComputerName_fhandle, Ora_Ffi.C_INT_PTR );
Ora_Ffi.Register_Return( GetComputerName_fhandle, Ora_Ffi.C_INT );
END;
BEGIN
Init;
END;
---- cut here ----

Similar Messages

  • Firefox.exe - entry point not found The Procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library Kernel32.dll

    Here's my problem, until yesterday my firefox browser is fine, unless sometimes when i playing games/app in facebook the plugin keep crashing but thats okay i can stop it and reload my firefox.
    But now everytime i try to open firefox it displaying the error massage:
    firefox.exe - entry point not found
    The Procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library Kernel32.dll
    I try to uninstall firefox, and reinstall again.
    i have to use internet explorer and torch browser, which don't fit me and make me in pain.
    i try to run in firefox safe mode, according to some suggestion here, but it wouldn't allow me to open Safe Mode (i even holding the Shift button when clicking on firefix icon)
    Can you guys help me in here?
    Iam using windows xp.
    Thank you so much in advance, GBU all :)

    hi, do you have service pack 3 installed on your xp computer?

  • Windows vista kernel32.dll

    I need some help, trying to install skype it gives me a fatal error that says: Failed to get proc address for GetLogicalProcessorInformation (kernel.dll).I was wondering if there was any way to fix it and for those saying "get a better pc" i would but money is tight.

    You need to update your Windows XP to the latest Service Pack 3 (SP3).
    https://support.skype.com/en/faq/FA12388/why-am-i-getting-a-fatal-error-kernel32-dll-when-i-try-to-l...
    http://www.microsoft.com/en-us/download/details.aspx?id=24

  • The procedure entry point getlogicalprocessorinformation could not be located in the dynamic link kernel32.dll   . I got this error after downloading and installing Frame MAker 12. My system os is service pack 2.

    The above mentioned error is displayed when i open Adobe Framemaker 12 after installing it.
    the procedure entry point getlogicalprocessorinformation could not be located in the dynamic link kernel32.dll
    this is the error.
    my os is windows service pack 2
    2 gb ram

    You don't mention which specific version of the operating system that you are using - Windows XP, Vista, or 7 and whether you're using a 32-bit or 64-bit version.
    FWIW, kernell32.dll is a Windows system-level module, so it's possible that you have some corruption in your Windows installation which is preventing FM from launching.
    Also, 2Gb of RAM is a bit lean for FM.

  • The procedure entry point GetLogicalProcessor Information could not be located in the dynamic link library KERNEL32.dll

    When I installed CS6 trial version and started from start menu and clicked Adobe photoshop CS6, I get this message.
    The procedure entry point GetLogicalProcessor Information could not be located in the dynamic link library KERNEL32.dll
    How to resolve it?

    Either your OS is damaged, or doesn't meet the minimum requirements for Photoshop CS6.

  • JAVA caused an invalid page fault in module KERNEL32.DLL at 016f:bff7b9a6

    Hi All,
    This problem is bugging me for last two days. Actually I am trying to embed Internet Explorer inside Java application. Everything is working fine till I dont close the application window. But just when I close the window everything goes down. I am working on win98 platform and not sure if it is this reason. The exact error message I am getting is:
    JAVA caused an invalid page fault in
    module KERNEL32.DLL at 016f:bff7b9a6.
    Registers:
    EAX=00000000 CS=016f EIP=bff7b9a6 EFLGS=00000246
    EBX=00000001 SS=0177 ESP=0c08fb7c EBP=653cfbd0
    ECX=004271ec DS=0177 ESI=653cfbd0 FS=443f
    EDX=00427310 ES=0177 EDI=0042701c GS=0000
    Bytes at CS:EIP:
    ff 76 04 e8 13 89 ff ff 5e c2 04 00 56 8b 74 24
    Stack dump:
    004272e4 653a8f88 653cfbd0 0042701c 004272e4 004271fc 00000000 653aaf7b 0042701c 0b1df32c 5f3ed308 0c08fc70 00000000 5f3e5adc 004272e4 5f3ed6d8
    Also since JVM is also crashing it is creating a log file which reads:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D0670CD
    Function=[Unknown.]
    Library=(N/A)
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
         at sun.awt.windows.WToolkit.eventLoop(Native Method)
         at sun.awt.windows.WToolkit.run(WToolkit.java:240)
         at java.lang.Thread.run(Thread.java:536)
    Dynamic libraries:
    0x7CC00000 - 0x7CC1D000      C:\WINDOWS\SYSTEM\IMAGEHLP.DLL
    Local Time = Tue May 14 18:46:45 2002
    Elapsed Time = 616
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.0-b92 mixed mode)
    I am not getting any clue about this error. Please help me out. :-(

    aman ghus jao bans balli bamboo lekar..

  • ITunes 10.5 won't open - kernel32.dll

    I'm having a few problems opening iTunes.  I was told a newer version was available by iTunes so I downloaded version 10.5.  Whenever I try to open iTunes after a few seconds it says 'iTunes has stopped working', then closes the program.  That's it, no explanation or error; nothing.
    I've uninstalled, emptied recycle bin, run virus checks, updated all security software and a Checkdisk and reinstalled from a fresh download, rebooted, and rebooted in safe mode, all of which have the same result when I try to open iTunes.  Quicktime and everything else runs fine.
    Hp Pavilion dv2000, Windows Vista, 32 bit
    Problem signature
    Problem Event Name:          APPCRASH
    Application Name:          iTunes.exe
    Application Version:          10.5.0.142
    Application Timestamp:          4e9243f2
    Fault Module Name:          kernel32.dll
    Fault Module Version:          6.0.6002.18449
    Fault Module Timestamp:          4da47967
    Exception Code:          c0000005
    Exception Offset:          00052136
    OS Version:          6.0.6002.2.2.0.768.3
    Locale ID:          2057
    Additional Information 1:          2ec5
    Additional Information 2:          f7733438e43439fdfce2037af5783aa7
    Additional Information 3:          2638
    Additional Information 4:          dfd02a8a8ce0af9af91ce8bbd8f3394c
    Files that help describe the problem
    Version.txt
    AppCompat.txt
    memory.hdmp
    minidump.mdmp

    I agree on deleting or getting the junk out of \Roaming\Apple.... Just to be clearer, I meant to say "move AND delete" just to be sure you have a copy somewhere, even if only to compare to. In the end I spent far too long looking for a needle in haystack rather than just start over.
    I had trouble on 10/19 so I then looked to see what was modified then.
    There are some other prefs that may be in AppData\Local as well that you want to dump.
    Two years into Windows 7 I was going to do clean install anyway. Was hoping there would be a 2nd Preview of 8 though. 10.5 works fine on Windows 8 except for iPod service and AMS, and was unable even with clean system install to upgrade iPod to iOS 5 --- that was what I really really wanted to accomplish and figure out, and even with clean install was a "dead end."
    Now I'm beginning to list or learn that some of my apps and others don't work with iOS 5 or iTunes 10.5.
    If some one has the luxury of a 2nd copy or hard drive or both to have another install of Windows, always useful, and one way to test and find out what works and then migrate files.

  • Why is the kernel32.dll being included with my executable?

    It's actually being included in the support files folder with the other dll's necessary for the executable.  It is not required for my executable, however, and when I put the executable on a computer outside of the development environment, the executable breaks when it runs.  If I delete the kernel32.dll from the support folder, the executable runs fine on the stand alone computer.  The frustrating thing about this is that this is new behavior for making this particular executable.  My development computer started adding the kernel32.dll to my executables that contain a certain sub vi a couple of months ago.  The offending sub vi has no library function calls to the dll that I can find or knowingly added. If I use a different development computer with the exact same source code and project file, the kernel32 dll is NOT included in the support folder.  It is only my particular development computer.  I looked at all the posts that contain a reference to the executables with kernel32.dll, like the one in the Knowledgebase "My Stand-Alone Executable Cannot Find My DLL, Even Though I Have Specified the Path for the DLL" and tried to add the system32 folder to the vi search path, but that did not do anything. I looked through all of the Options pages but did not find anything that seemed relevant.  Did I miss some setting that I inadvertantly modified to start getting this behavior?
     
    Please let me know what I can look for to try and fix this problem.  It is not an acceptable solution to have users go into the support folder and delete this file after the program is installed on their computer.  It is also not reasonable for me to use a different computer each time I want to create an executable, and I really don't want to reinstall all of the many parts and modules of LV on my computer.
     
    Thanks,
    Craig

    Duplicate post

  • Faulting application firefox.exe, version 36.0.0.5531, faulting module kernel32.dll, version 5.1.2600.3119, fault address 0x00012a5b

    I cannot get firefox to start. It keeps crashing with the following message:
    The procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library KERNEL32.dll
    I tried uninstalling and reinstalling. I uninstalled and removed the directory from program files, and reinstalled. I scanned the system for viruses. Still no good, same problem.
    Details show: Faulting application firefox.exe, version 36.0.0.5531, faulting module kernel32.dll, version 5.1.2600.3119, fault address 0x00012a5b

    kernel32.dll 5.1.2600.3119 looks like a Windows XP version.
    A Google search would suggest that this is a file from XP SP2, so best would be to update that computer to SP3
    If this happens on a Windows 7 computer then make sure that you aren't running Firefox in compatibility mode.
    You can open the Properties of the Firefox desktop shortcut via the right-click context menu and check the "Compatibility" tab.
    Make sure that all items are deselected in the "Compatibility" tab of the Properties window.
    Bug 1137609 - The Procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library Kernel32.dll for XP users after update to Firefox 36

  • The procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library KERNEL32.dll

    I tried to download Photoshop CS6, but when I tried to open it said "The procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library KERNEL32.dll." I dont know what to do HELP PLEASE!

    Branched this off to a new discussion.  Maza255 please make sure you meet the minimum system requirements for Photoshop CS6 - http://www.adobe.com/products/photoshop/tech-specs.html.

  • When trying to update flash..getting "procedure entry point setdiidirectoryw could not be located in the dynamic link library kernel32.dll"

    When trying to update flash..getting "procedure entry point setdiidirectoryw could not be located in the dynamic link library kernel32.dll"

    this is a mere adobe bug - they changed the installer & it wont support installation on windows 2000 system any longer. adobe doesn't seem as it is going to fix this bug, see [https://bugbase.adobe.com/index.cfm?event=bug&id=3120661].
    you might want to try this installation method provided by a 3rd-party-site: [http://www.ortwinpinke.de/en/2012/03/13/install-adobe-flash-player-11110262-and-later-under-windows-2000/]
    please note that mozilla firefox won't support the windows 2000 platform any longer after the release of version 12 of the browser & the system is no longer supported or kept up to date with security fixes by microsoft too. in order to keep your computer & personal information on it safe you may consider upgrading to a newer system.

  • Interfacing LabVIEW to the GetFileTime function in kernel32.dll

    I am attempting to get the creation date/time of a file. The GetFileTime function inside kernel32.dll seems like a good choice. It requires a handle to the file, so I open the file, typecast the refnum to a U32 and pass the U32 to the Call Library function node. The outputs I expect are pointers to strings, so I use the C string pointer.
    I am at a loss of why this doesn't work. I have my crude VI (LV7.0) attached.
    Attachments:
    Get_File_Times.zip ‏13 KB

    Hi,
    If you use GetFileTime, the handle has to be opened with:
    HFILE OpenFile(
    LPCSTR lpFileName, // file name
    LPOFSTRUCT lpReOpenBuff, // file information
    UINT uStyle // action and attributes
    LV's file handle is not compatible!
    Also, this function is tricky. lpCreationTime is not a pointer to a string,
    but a pointer to a FILETIME structure. You should provide it with pointers
    to clusters with two U32's in it. You can do this by making a cluster with
    two integers in it, and wire it (three times) to the dll. The dll has to be
    configured as "adapt to type".
    You should convert the FILETIME structures to SYSTEMTIME's with:
    BOOL FileTimeToSystemTime(
    CONST FILETIME *lpFileTime, // file time to convert
    LPSYSTEMTIME lpSystemTime
    // receives system time
    Regards,
    Wiebe.
    "Mark Borodkin" wrote in message
    news:[email protected]..
    > I am attempting to get the creation date/time of a file. The
    > GetFileTime function inside kernel32.dll seems like a good choice. It
    > requires a handle to the file, so I open the file, typecast the refnum
    > to a U32 and pass the U32 to the Call Library function node. The
    > outputs I expect are pointers to strings, so I use the C string
    > pointer.
    >
    > I am at a loss of why this doesn't work. I have my crude VI (LV7.0)
    > attached.

  • Invalid page fault error in module kernel32.dll

    I'm a VB programmer attempting to learn java. I downloaded the j2se 1.40 sdk (At present I am running Windows 98) and installed it. The download and installation process was smooth. However when I attempt to launch the program, I get the illegal operation dialog with details as follows:
    SPLASH caused an invalid page fault in
    module KERNEL32.DLL at 0177:bff766bc.
    Registers:
    EAX=0055003c CS=0177 EIP=bff766bc EFLGS=00010202
    EBX=00000000 SS=017f ESP=00550000 EBP=00550010
    ECX=00000000 DS=017f ESI=00550108 FS=305f
    EDX=bff76855 ES=017f EDI=817b5b68 GS=0000
    Bytes at CS:EIP:
    e8 13 ad ff ff 8b 55 08 8f 82 b0 00 00 00 8b 4d
    Stack dump:
    002a0014 00000000 0055003c 0055003c 00550024 bff766fd 0055003c 005501b4 00000000 005501b4 bff883ed 0055003c bff79060 00000000 0064ffec ffffffff
    I suspect this has something to do with the OS. Can anyone shed some light on this for me.
    Thanks
    Nancy

    What command did you use to launch the program?
    The readme file explains how to set the path and classpath; if you've done that, try this command in a DOS window:
    java -version
    C:\>java -version
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
    Good luck,
    Mike Rainville

  • ITunes has stopped working (kernel32.dll)

    Hi,
    Everytime i try to open iTunes i get an error message: "iTunes has stopped working".
    Here's the error log:
    Problem signature:
      Problem Event Name: APPCRASH
      Application Name: iTunes.exe
      Application Version: 10.5.0.142
      Application Timestamp: 4e9243f2
      Fault Module Name: kernel32.dll
      Fault Module Version: 6.0.6000.16820
      Fault Module Timestamp: 49952034
      Exception Code: c0000005
      Exception Offset: 0004736d
      OS Version: 6.0.6000.2.0.0.768.3
      Locale ID: 1033
      Additional Information 1: 1beb
      Additional Information 2: 562f49e97f416fe9d7e7c794b99abd6c
      Additional Information 3: 8f9f
      Additional Information 4: b17724af286c8cd46f69e86465915c63
    Before in "Fault Module Name" it said something like "Stackhash error" but that went away after i properly installed quick time player. I've tried many different things i read online to fix it like: Uninstalling and reinstalling, manually removing my entire library, and creating another user in the control panel then trying to run iTunes with no success.
    Any help would be greatly appreciated, Let me know if you need any other information.

    That one is one of your operating system files, Jay:
    http://www.win7dll.info/audioses_dll.html
    So, it's possible that an sfc /scannow might be of some help:
    [How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7|http://support.microsoft.com/kb/929833]

  • Where can I download kernel32.dll safely?

    Hi everyone, is it possible to get kernel32.dll for free from reasonable people - I mean no hacker site? Each time I try to install flash player I keep getting an error message: "The procedure entry point RtlCaptureContext could not be located in the dynamic link library KERNEL32.dll." And is this the way to get Flash Player Running? (My system: Windows2000 Professional).
    Kind regards,
    Heidi

    Don't do it - KERNEL32.DLL is an integral part of your operating system; don't exchange it with a different version!
    What is the version of your KERNEL32.DLL file?  On my Windows 2000 (SP4) system the version is 5.0.2195.7135, dated 2007-04-16, size 697KB.
    If you have the same, then you have the correct version for your system.
    Now for your error message (which I did not get when I installed Flash Player on my system):
    what is your browser?
    what version are you trying to install?
    what is the name of your installer?  (or are you installing via DLM?)

Maybe you are looking for

  • Print problem with HP Deskjet 3512

    I have an error when I try to eprint on my HP Deskjet 3512   I tried to print, and it didn't print...my computer said I had an error.  No error showing on my printer.  Now when I try to print, I get a message saying that it has to print the previous

  • No authorization for action: CRE with object: ADCP

    Hi, I encountered the following error when creating an index: No authorization for action: CRE with object: ADCP I was at transaction DB02 -> 'Checks' -> Database<->ABAP/4 Dictionary. The checks indicate that there are some optional indexes that are

  • HR ABAP (PA)

    Hi Experts I need all the information from Infotypes PA Into one Table.My client  see the information for Each Person All the data.If its possible send to me Sample Program .

  • 'Invisible' or 'disappearing' folder (Very weird)

    Hi everyone, here's something for you to get your teeth stuck into! I finally persuaded my partner to switch from PC to Mac and she's got a shiny new (refurbished) Macbook 2.2Ghz, 2GB RAM running 10.5.3. It's the first Leopard machine I've had to pla

  • No commitment items selected

    I use Fund Management and Material Ledger in ECC 6.0. When I excute the post closing in the CKMLCP Edit Costing Run, and the system show a error message No commitment items selected Message no. FI606 I search the solution on SDN Community, and find s