Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2018, 20:40
bugficks bugficks is offline
Friend
 
Join Date: Apr 2018
Posts: 8
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 3
Thanks Rcvd at 14 Times in 8 Posts
bugficks Reputation: 0
w/ thread_local its a per thread map and lib is loaded/freed per thread, if that thread exits is see no problem there. OS lib ref count is the same as it was before thread was entered.

well again, this was just a c++ type safe replacement for original post, nothing more nothing less. if you want to do an uber lib loader youre free to do so

if you want to optimize lookup you could as well just add an optional opaque pointer and store some infos there.
e.g.:
PHP Code:
template <typename Ftypename... ArgTypes>
auto DynCallT(void **opaqueLPCTSTR libNameLPCSTR funcNameArgTypes... args)

    if(
opaque && *opaque
    { (
cast_opaque_t)(opaque) ...} 
    ... 
    if(
opaque
    { *
opaque=... }
    ...
}
void *ppp=0;
for(...) 
DynCallT(ppp, ...); 
anyways, it is what it is and it doesnt want to be more
Reply With Quote
The Following User Says Thank You to bugficks For This Useful Post:
Indigo (07-19-2019)
  #2  
Old 05-08-2018, 05:08
aliali aliali is offline
Friend
 
Join Date: Jan 2002
Posts: 61
Rept. Given: 4
Rept. Rcvd 8 Times in 4 Posts
Thanks Given: 3
Thanks Rcvd at 15 Times in 8 Posts
aliali Reputation: 8
Quote:
Originally Posted by bugficks View Post
w/ thread_local its a per thread map and lib is loaded/freed per thread, if that thread exits is see no problem there. OS lib ref count is the same as it was before thread was entered.

well again, this was just a c++ type safe replacement for original post, nothing more nothing less. if you want to do an uber lib loader youre free to do so

if you want to optimize lookup you could as well just add an optional opaque pointer and store some infos there.
e.g.:
PHP Code:
template <typename Ftypename... ArgTypes>
auto DynCallT(void **opaqueLPCTSTR libNameLPCSTR funcNameArgTypes... args)

    if(
opaque && *opaque
    { (
cast_opaque_t)(opaque) ...} 
    ... 
    if(
opaque
    { *
opaque=... }
    ...
}
void *ppp=0;
for(...) 
DynCallT(ppp, ...); 
anyways, it is what it is and it doesnt want to be more
Is it possible to have a pure ANSI C implementation of the above code
Reply With Quote
The Following User Says Thank You to aliali For This Useful Post:
Indigo (07-19-2019)
  #3  
Old 10-17-2018, 19:36
0xall0c 0xall0c is offline
Friend
 
Join Date: Mar 2018
Posts: 70
Rept. Given: 0
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 28
Thanks Rcvd at 68 Times in 36 Posts
0xall0c Reputation: 4
Quote:
Originally Posted by aliali View Post
Is it possible to have a pure ANSI C implementation of the above code
not possible, as i know, but there can be work around at lower levels
Reply With Quote
The Following User Says Thank You to 0xall0c For This Useful Post:
Indigo (07-19-2019)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling any function dynamically without typedef Succubus Source Code 0 10-21-2021 16:34
WinAPI: No WM_COMMAND Message? aldente General Discussion 2 07-05-2006 07:17


All times are GMT +8. The time now is 21:04.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )