Re: Question - open_dll()
- Posted by jessedavis Aug 14, 2016
- 1447 views
OK, I ran the process logger and found the following for my .dll (now called beu.dll to avoid any confusion with eu):
"2:40:17.4151586 PM","euiw.exe","4272","CreateFile","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","SUCCESS","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"2:40:17.4152695 PM","euiw.exe","4272","QueryBasicInformationFile","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","SUCCESS","CreationTime: 8/12/2016 5:08:00 AM, LastAccessTime: 8/12/2016 5:08:00 AM, LastWriteTime: 8/12/2016 4:12:02 AM, ChangeTime: 8/13/2016 2:37:07 PM, FileAttributes: A"
"2:40:17.4153241 PM","euiw.exe","4272","CloseFile","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","SUCCESS",""
"2:40:17.4157399 PM","euiw.exe","4272","CreateFile","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","SUCCESS","Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened"
"2:40:17.4158588 PM","euiw.exe","4272","CreateFileMapping","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","FILE LOCKED WITH ONLY READERS","SyncType: SyncTypeCreateSection, PageProtection: "
"2:40:17.4161461 PM","euiw.exe","4272","CreateFileMapping","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","SUCCESS","SyncType: SyncTypeOther"
"2:40:17.4164209 PM","euiw.exe","4272","CloseFile","C:\Users\Jesse\Software\Euphoria\dll_test\beu.dll","SUCCESS",""
the file beu.dll resides in the C:\Users\Jesse\Software\Euphoria\dll_test\ directory which is the same directory that holds the eu program trying to access the .dll. It would appear that things are going along fine.
include std/dll.e include jd/jd.e atom dll_pntr = open_dll("beu.dll") --also tried atom dll_pntr = open_dll("C:\\Users\\Jesse\\Software\\Euphoria\\dll_test\\beu.dll") printf(1,"dll_pntr = %d\n",dll_pntr)
The above code prints out dll_pntr = 0
I do not follow all of this; however, it seems to me that it discovered the file, got the basic information about it, created a map and then closed it.
I will say that procmon is a neat program. Very useful.
Here is the c code for both the .dll and the test program.
//This is the code inside the .dll created with dev c++ in the C only mode #include <stdio.h> __declspec(dllexport) int add(int a, int b) { return a+b; } __declspec(dllexport) void ftn(void) { puts("Inside DLL\n"); } ----------------------------------------------------- //This is the C test program: #include <stdio.h> __declspec(dllimport) int add(int a, int b); __declspec(dllimport) void ftn(void); int main(void) { ftn(); printf("Answer is: %d\n",add(3,5)); return 1; }
Here is the output of the dll explorer:
add 0x6d3c1430 0x00001430 1 (0x1) Beu.dll ftn 0x6d3c1444 0x00001444 2 (0x2) Beu.dll
I can email you the actual .dll file; however, I think it's OK. Please don't spend too much time on this. It can always remain "just another mystery".
Thanks for your help,
jd