0

Hi I am using COM Class and loading it in browser.

I am calling LoadLibrary of kernel32 but it returns me zero.

I have also tried using LoadLibraryEx which gives me pointer to DLL but when I call any function of that dll it gives me Attempt to read or write protected memory.

<DllImport("kernel32.dll", EntryPoint:="LoadLibraryEx")> _
    Public Shared Function LoadLibraryEx(ByVal lpLibFileName As String, ByVal hint As IntPtr, ByVal hparam As UInteger) As IntPtr
    End Function

<UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet:=CharSet.Unicode)> _
    Public Delegate Function LoadIdcardLibrary() As Integer

Dim lb As IntPtr = LoadLibraryEx("\idcarddll.dll", IntPtr.Zero, 8)
i = Marshal.GetDelegateForFunctionPointer(pb, GetType(LoadIdcardLibrary)).DynamicInvoke()

Thanks in advance

Edited by mahendrabhatt: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by mahendrabhatt
0

>I am calling LoadLibrary of kernel32 but it returns me zero.

Because it fails to load due to lack of privileges.

0

>I am calling LoadLibrary of kernel32 but it returns me zero.

Because it fails to load due to lack of privileges.

How to set privileges to load dll file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.