Guru3D.com Forums

Go Back   Guru3D.com Forums > Affiliates > RivaTuner Advanced Discussion forum
RivaTuner Advanced Discussion forum This forum is intended for advanced comments, ideas and general discussion of the RivaTuner Utility which is hosted here at the Guru of 3D. This forum is visited by programmer himself - you can only post in this area with a minimum of 10 posts and 7 days forum membership.


Reply
 
Thread Tools Display Modes
initialize and cleanup function in plugins
Old
  (#1)
fgw
Member Guru
 
fgw's Avatar
 
Videocard: MSI N680GTX Lightning
Processor: Intel Core i7 990X
Mainboard: ASUS Rampage III Extreme
Memory: Corsair CMT6GX3M3A2000C8
Soundcard: Realtek (ASUS onboard)
PSU: Antec HCG-520
Default initialize and cleanup function in plugins - 02-19-2010, 12:09 | posts: 103

alex, i'm currently in plugin programming again. tried to move one of my plugins, which is using wmi to gather some system data, to a windows 7 system. unfortunately the plugin refused to work on this platform.

investigating this issue revealed, that i used to call some initialization code (to initialize wmi) within dllmain and this is, as ms recommends, most of the time a very bad idea!

ok, i was able to work around this by moving my initialization code into GetSourcesNum and GetSourceDesc, but where to place the cleanup code? for now i simply left the cleanup code in dllmain as it seems to work, but a clean solution would be to supply two additional entrypoints in the dll to do this stuff.

this leads me to the question if it would be possible to add two function calls to rivatuner:

right now i'm using the following functions called by rivatuner in my dll's:
  • GetSourcesNum
  • GetSourceDesc
  • GetSourceCaps
  • GetSourceData
  • SetupSource

what i'm missing are two additional functions to be called by rivatuner:

InitializePlugin (or call it whatever you like)
to be called immediately after calling DllMain with
dwReason == DLL_PROCESS_ATTACH

CleanupPlugin (or call it whatever you like)
to be called immediately before calling DllMain with
dwReason == DLL_PROCESS_DETACH

may be there is already a mechanism to accomplish this, but i was not able to find a solution ...
   
Reply With Quote
 
Old
  (#2)
Unwinder
Moderator
 
Videocard:
Processor:
Mainboard:
Memory:
Soundcard:
PSU:
Default 02-26-2010, 10:44 | posts: 10,364 | Location: Taganrog, Russia

ok, will think what I can do.


Alexey Nicolaychuk aka Unwinder, RivaTuner creator
   
Reply With Quote
Old
  (#3)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core 2 Quad Q9550
Mainboard: ASUS Striker II Extreme
Memory: 4GB DDR3 OCZ Reaper 14400
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 02-26-2010, 17:36 | posts: 563 | Location: MA

I'll add a 2nd vote for this functionality.
   
Reply With Quote
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 Off

Forum Jump



Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
Copyright (c) 1995-2012, All Rights Reserved. The Guru of 3D, the Hardware Guru, and 3D Guru are trademarks owned by Hilbert Hagedoorn.