mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Cosmetic changes to code.
This commit is contained in:
@ -61,7 +61,7 @@ float getHighestTemp();
|
||||
|
||||
/*
|
||||
This function is called when the measure is initialized.
|
||||
The function must return the maximum value that can be measured.
|
||||
The function must return the maximum value that can be measured.
|
||||
The return value can also be 0, which means that Rainmeter will
|
||||
track the maximum value automatically. The parameters for this
|
||||
function are:
|
||||
@ -73,10 +73,10 @@ float getHighestTemp();
|
||||
*/
|
||||
UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
|
||||
{
|
||||
/*
|
||||
Read our own settings from the ini-file
|
||||
/*
|
||||
Read our own settings from the ini-file
|
||||
The ReadConfigString can be used for this purpose. Plugins
|
||||
can also read the config some other way (e.g. with
|
||||
can also read the config some other way (e.g. with
|
||||
GetPrivateProfileInt, but in that case the variables
|
||||
do not work.
|
||||
*/
|
||||
@ -100,7 +100,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -17,34 +17,34 @@ bool CSharedMemClient::ReadSharedMem(PCORE_TEMP_SHARED_DATA i_SharedData)
|
||||
HANDLE hdlMutex;
|
||||
|
||||
hdlMutex = CreateMutex(NULL,FALSE,CORE_TEMP_MUTEX_OBJECT);
|
||||
if (hdlMutex == NULL)
|
||||
{
|
||||
if (hdlMutex == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WaitForSingleObject(hdlMutex, INFINITE);
|
||||
|
||||
}
|
||||
|
||||
WaitForSingleObject(hdlMutex, INFINITE);
|
||||
|
||||
hdlMemory = OpenFileMapping(
|
||||
FILE_MAP_READ, // Read only permission.
|
||||
TRUE,
|
||||
FILE_MAP_READ, // Read only permission.
|
||||
TRUE,
|
||||
CORE_TEMP_MAPPING_OBJECT); // "CoreTempMappingObject"
|
||||
|
||||
if (hdlMemory == NULL)
|
||||
{
|
||||
ReleaseMutex(hdlMutex);
|
||||
|
||||
if (hdlMemory == NULL)
|
||||
{
|
||||
ReleaseMutex(hdlMutex);
|
||||
CloseHandle(hdlMutex);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pSharedData = (PCORE_TEMP_SHARED_DATA)MapViewOfFile(hdlMemory, FILE_MAP_READ, 0, 0, 0);
|
||||
if (pSharedData == NULL)
|
||||
if (pSharedData == NULL)
|
||||
{
|
||||
CloseHandle(hdlMemory);
|
||||
hdlMemory = NULL;
|
||||
ReleaseMutex(hdlMutex);
|
||||
ReleaseMutex(hdlMutex);
|
||||
CloseHandle(hdlMutex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
__try
|
||||
{
|
||||
@ -59,7 +59,7 @@ bool CSharedMemClient::ReadSharedMem(PCORE_TEMP_SHARED_DATA i_SharedData)
|
||||
|
||||
UnmapViewOfFile(pSharedData);
|
||||
CloseHandle(hdlMemory);
|
||||
ReleaseMutex(hdlMutex);
|
||||
ReleaseMutex(hdlMutex);
|
||||
CloseHandle(hdlMutex);
|
||||
|
||||
return bRet;
|
||||
|
Reference in New Issue
Block a user