Hello once again FASM experts,
I am here yet again with another problem. This time i'm trying to figure out DLL's and i'm having a bit of trouble with my example. It seems to compile fine and so does the app I create with it. The problem is, once I run my app, Notepad does pop up, but so does a Microsoft error asking me if I want to report my error. What could be the problem? Here is is my DLL and App in full:
ShellX.dll:
format pe gui DLL
entry DllMain
include 'win32a.inc'
section '.data' data readable writeable
a db 'notepad',0
section '.code' code readable executable
proc DllMain,hinstDll,fdwReason,lpvReserved
mov eax,1
ret
Shell:
invoke ShellExecute,0,0,a,0,0,5
[color=red]ret[/color]
endp
section '.idata' import data readable
library shell32,'shell32.dll'
import shell32,ShellExecute,'ShellExecuteA'
section '.edata' export data readable
export 'ShellX',Shell,'Shell'
section '.reloc' fixups data discardable
Notepad.asm
format pe gui
entry Test
include 'win32ax.inc'
section '.code' code import writeable readable executable
library ShellX,'ShellX.dll'
import ShellX,Shell,'Shell'
Test:
invoke Shell
ret
EDIT: Nevermind. I have it fixed. I forgot to put "ret" under "Shell:".