mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Disabled the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls in all DLLs.
DisableThreadLibraryCalls Function http://msdn.microsoft.com/en-us/library/ms682579.aspx Note: Do not call "DisableThreadLibraryCalls" in a DLL which is statically linked to the CRT http://support.microsoft.com/kb/555563/en-us For plugin author: If you need to implement DllMain entry point yourself, get rid of the #include "DisableThreadLibraryCalls.h" line.
This commit is contained in:
parent
adc930275d
commit
92eafce2dc
50
Library/DisableThreadLibraryCalls.h
Normal file
50
Library/DisableThreadLibraryCalls.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright (C) 2011 spx
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _DISABLETHREADLIBRARYCALLS_H_
|
||||
#define _DISABLETHREADLIBRARYCALLS_H_
|
||||
|
||||
// DisableThreadLibraryCalls Function
|
||||
// http://msdn.microsoft.com/en-us/library/ms682579.aspx
|
||||
//
|
||||
// Note: Do not call "DisableThreadLibraryCalls" in a DLL which is statically linked to the CRT
|
||||
// http://support.microsoft.com/kb/555563/en-us
|
||||
|
||||
#if defined(_DLL) /* /MD */
|
||||
|
||||
/*
|
||||
** DllMain
|
||||
**
|
||||
** Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls.
|
||||
**
|
||||
*/
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hinstDLL);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -2123,6 +2123,10 @@
|
||||
RelativePath="ConfigParser.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DisableThreadLibraryCalls.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Error.h"
|
||||
>
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "Resource.h"
|
||||
#include "UpdateCheck.h"
|
||||
|
||||
#include "DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
using namespace Gdiplus;
|
||||
|
||||
CRainmeter* Rainmeter; // The module
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <map>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
//ULONGLONG GetPerfData(PCTSTR ObjectName, PCTSTR InstanceName, PCTSTR CounterName);
|
||||
void UpdateProcesses();
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <math.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
//#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
|
||||
__declspec( dllexport ) void Finalize(HMODULE instance, UINT id);
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <map>
|
||||
#include "FolderInfo.h"
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
#define UPDATE_TIME_MIN_MS 10000
|
||||
|
||||
using namespace PluginFolderInfo;
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <string>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <crtdbg.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
ULONGLONG GetPerfData(PCTSTR ObjectName, PCTSTR InstanceName, PCTSTR CounterName);
|
||||
|
||||
struct PerfMeasure
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <stdlib.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <Powrprof.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
typedef struct _PROCESSOR_POWER_INFORMATION
|
||||
{
|
||||
ULONG Number;
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <shlwapi.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include <time.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include <psapi.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <map>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <Iphlpapi.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -72,6 +72,8 @@
|
||||
|
||||
#include "../../Library/Export.h"
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllexport) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include "..\..\Library\pcre-8.10/pcre.h"
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -26,6 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#pragma comment( lib, "wlanapi.lib")
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
#define SAFE_RELEASE(punk) \
|
||||
if ((punk) != NULL) { (punk)->Release(); (punk) = NULL; }
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <time.h>
|
||||
#include "..\..\Library\Export.h" // Rainmeter's exported functions
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
/* The exported functions */
|
||||
extern "C"
|
||||
{
|
||||
|
@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include <map>
|
||||
#include <time.h>
|
||||
|
||||
#include "../../Library/DisableThreadLibraryCalls.h" // contains DllMain entry point
|
||||
|
||||
const int VOLUME_STEP = 5;
|
||||
|
||||
/* The exported functions */
|
||||
|
Loading…
Reference in New Issue
Block a user