View Single Post
  #5  
Old 05-03-2020, 07:51
phroyt phroyt is offline
Friend
 
Join Date: May 2018
Posts: 69
Rept. Given: 0
Rept. Rcvd 7 Times in 3 Posts
Thanks Given: 27
Thanks Rcvd at 94 Times in 38 Posts
phroyt Reputation: 7
Talking

That's the point.

I always thought it worked like this.

But unknown code are sent

Code:
DLLInit: 0x00000001 => DLL_PROCESS_ATTACH
DLLInit: 0x6CBE2728
DLLInit: 0x6D992728
DLLInit: 0x064DBC38
The normal values are:
Code:
  DLL_PROCESS_ATTACH = 1;
  {$EXTERNALSYM DLL_PROCESS_ATTACH}
  DLL_THREAD_ATTACH = 2;
  {$EXTERNALSYM DLL_THREAD_ATTACH}
  DLL_THREAD_DETACH = 3;
  {$EXTERNALSYM DLL_THREAD_DETACH}
  DLL_PROCESS_DETACH = 0;
  {$EXTERNALSYM DLL_PROCESS_DETACH}
The first one (DLL_PROCESS_ATTACH) is called by myself on BEGIN section.

Code:
begin
  //DLLProc := TDLLProc(@DllInit);
  DllInit(DLL_PROCESS_ATTACH);
end.
I tested moving this code to Unit Initialization Section and works like a charm too.

Like you said, probably a DLLProc erratic behavior.

Thanks
Reply With Quote