From 8a6cd84bd31d9f5bbcc5f2256e156ed37326cf9b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 May 2013 14:04:14 +0000 Subject: no more WIN64, only _WIN64 git-svn-id: http://svn.miranda-ng.org/main/trunk@4832 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CryptoPP/crypto/src/config.h | 4 +- plugins/CryptoPP/src/commonheaders.h | 2 +- plugins/LotusNotify/src/LotusNotify.cpp | 160 ++++++++++++++++---------------- plugins/PluginUpdater/src/Utils.cpp | 72 +++++++------- 4 files changed, 118 insertions(+), 120 deletions(-) (limited to 'plugins') diff --git a/plugins/CryptoPP/crypto/src/config.h b/plugins/CryptoPP/crypto/src/config.h index a33577577e..02f05f1ca3 100644 --- a/plugins/CryptoPP/crypto/src/config.h +++ b/plugins/CryptoPP/crypto/src/config.h @@ -261,7 +261,7 @@ NAMESPACE_END #define CRYPTOPP_DISABLE_SSE2 #endif -#ifdef WIN64 +#ifdef _WIN64 #define CRYPTOPP_DISABLE_ASM #endif @@ -317,7 +317,7 @@ NAMESPACE_END # define CRYPTOPP_NOINLINE __attribute__((noinline)) #else # define CRYPTOPP_NOINLINE_DOTDOTDOT ... -# define CRYPTOPP_NOINLINE +# define CRYPTOPP_NOINLINE #endif // how to declare class constants diff --git a/plugins/CryptoPP/src/commonheaders.h b/plugins/CryptoPP/src/commonheaders.h index d6eae14c33..aa2b79c773 100644 --- a/plugins/CryptoPP/src/commonheaders.h +++ b/plugins/CryptoPP/src/commonheaders.h @@ -9,7 +9,7 @@ #define _CRT_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS #define NOMINMAX - #ifndef WIN64 + #ifndef _WIN64 #define _USE_32BIT_TIME_T #endif #endif diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 2cc5c66e64..dbfea1a442 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -98,7 +98,7 @@ PLUGININFOEX pluginInfo = { // authentication callback futnction from extension manager called by nnotes.dll -STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) +STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) { VARARG_PTR pArgs; DWORD maxPwdLen; @@ -123,7 +123,7 @@ STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) } -//Main entry point for Ext Manager of Lotus API. called by nnotes.dll +//Main entry point for Ext Manager of Lotus API. called by nnotes.dll //It don't work (don't know why), and Mirandas Load function is called with value 1 or 0 as parameter... __declspec(dllexport)STATUS LNPUBLIC MainEntryPoint (void) { @@ -132,14 +132,14 @@ __declspec(dllexport)STATUS LNPUBLIC MainEntryPoint (void) if(rc) { //Extension magager don't know who we are :( startuperror+=8; - // Get the info from the .ini file + // Get the info from the .ini file } return rc; } //Clear Extension Manager when exiting -void ExtClear() +void ExtClear() { STATUS status; if (0 != hLotusRegister) { @@ -211,7 +211,7 @@ void deleteElements() { struct HISTORIA *cur = first, *del; while(cur != NULL) - { + { del = cur; cur = cur->next; deletePopupsHandles(&(del->pq),FALSE); @@ -298,7 +298,7 @@ BOOL checkFilters(TCHAR* str, int field) _tcsncpy_s(buff, SIZEOF(buff), settingFilterTo, SIZEOF(buff)); break; } - + while(strptr = _tcschr(buff, ';')) { @@ -317,7 +317,7 @@ BOOL checkFilters(TCHAR* str, int field) } -//subfunction called from popup plugin callback function +//subfunction called from popup plugin callback function void Click(HWND hWnd,BOOL execute) { POPUPATT *pid=NULL; @@ -353,7 +353,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA if (HIWORD(wParam) == STN_CLICKED)//client clicked on popup with left mouse button { Click(hWnd,TRUE); - + //system(settingCommand); //if(!settingOnceOnly) //addNewId(noteID); @@ -367,7 +367,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA { Click(hWnd,FALSE); break; - } + } case UM_INITPOPUP: { @@ -378,14 +378,14 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA break; } - case UM_FREEPLUGINDATA: + case UM_FREEPLUGINDATA: { POPUPATT * mpd = NULL; mpd = (POPUPATT*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd); if (mpd > 0) free(mpd); return TRUE; //TRUE or FALSE is the same, it gets ignored. } - + default: break; } @@ -427,7 +427,7 @@ BOOL checkNotesIniFile(BOOL bInfo) } } } - + if(settingIniAnswer == 1) { if(strlen(tmp) > 0) { @@ -440,7 +440,7 @@ BOOL checkNotesIniFile(BOOL bInfo) (OSSetEnvironmentVariable1) ("EXTMGR_ADDINS", tmp); //set notes.ini entry if(bInfo) { MessageBox(NULL, TranslateT("notes.ini modified correctly. Miranda restart required."), TranslateT("LotusNotify plugin configuration"), MB_OK); - } else{ + } else{ ErMsgT(TranslateT("notes.ini modified correctly. Miranda restart required.")); } return TRUE; @@ -480,7 +480,7 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID) _tcscpy_s(ppd.lptzText, SIZEOF(ppd.lptzText), text); if(settingSetColours) { - ppd.colorBack = settingBgColor; + ppd.colorBack = settingBgColor; ppd.colorText = settingFgColor; } ppd.PluginWindowProc = PopupDlgProc; @@ -521,7 +521,7 @@ void ErMsgT(TCHAR* msg) } -//Lotus error occured so translate it +//Lotus error occured so translate it void ErMsgByLotusCode(STATUS erno) { char far error_text_LMBCS[200]; @@ -537,7 +537,7 @@ void ErMsgByLotusCode(STATUS erno) } -//set menu avainability +//set menu avainability static void LNEnableMenuItem(HANDLE hMenuItem, BOOL bEnable) { log_p(L"LNEnableMenuItem: bEnable=%d", bEnable); @@ -554,7 +554,7 @@ static void LNEnableMenuItem(HANDLE hMenuItem, BOOL bEnable) int check() { log_p(L"check: Entering check function. running=%d", running); - + if(startuperror) { int cnt; for(cnt = 0; cnt <= 4; cnt++) @@ -562,7 +562,7 @@ int check() { ErMsgT(TranslateTS(startuperrors[cnt])); return 1; } - + if (Plugin_Terminated || Miranda_Terminated()){ log_p(L"check: Plugin_Terminated (=%d) OR Miranda_Terminated()", Plugin_Terminated); return 0; @@ -622,7 +622,7 @@ void checkthread(void*) goto errorblock; } log_p(L"checkthread: OSPathNetConstruct: %S", fullpath); - + if (error = (NSFDbOpen1) (fullpath, &db_handle)) { if(strcmp(settingServerSec, "") != 0) { if (error = (OSPathNetConstruct1)(NULL, settingServerSec, settingDatabase, fullpath)) { @@ -658,15 +658,15 @@ void checkthread(void*) } log(L"checkthread: Unread Table updated"); assert(hTable); - + while((IDScan1)(hTable, fFirst, ¬eID)) { - + WORD Att; BLOCKID bhAttachment; DWORD cSize = 0; DWORD attSize = 0; - OID retNoteOID; + OID retNoteOID; TIMEDATE retModified; /* modified timedate */ WORD retNoteClass; /* note class */ TIMEDATE sendDate; @@ -676,7 +676,7 @@ void checkthread(void*) log_p(L"checkthread: Plugin_Terminated (=%d) OR Miranda_Terminated()", Plugin_Terminated); break; } - + log_p(L"checkthread: Getting info about: %d", noteID); fFirst = FALSE; @@ -697,19 +697,19 @@ void checkthread(void*) //show again, but only not clicked (id added to list on Left Button click) continue; } - + log(L"checkthread: skiped-show again, but only not clicked (id added to list on Left Button click)"); if(settingNewest && settingNewestID >= noteID){ //only newest option enabled, so if old id don't show it continue; } - + log(L"checkthread: skiped-only newest option enabled, so if old id don't show it"); //if(((!settingOnceOnly||(settingOnceOnly&&settingNonClickedOnly))&&existElem(noteID))||(settingNewest&&settingNewestID>=noteID)) //continue; - + if (error = (NSFNoteOpen1) (db_handle, noteID, 0, ¬e_handle)) { continue; } @@ -792,7 +792,7 @@ void checkthread(void*) ); #endif - + if(attSize){ WCHAR field_attachments_UNICODE[MAX_FIELD]; swprintf_s(field_attachments_UNICODE, SIZEOF(field_attachments_UNICODE), TranslateW(L"Attachments: %d bytes"), attSize); @@ -910,7 +910,7 @@ void fillServersList(HWND hwndDlg) BYTE far *pServerList; /* Pointer to start of Server List */ WORD wServerCount; /* Number of servers in list. */ WORD far *pwServerLength; /* Index to array of servername lens */ - BYTE far *pServerName; + BYTE far *pServerName; STATUS error = NOERROR; /* Error return from API routines. */ char ServerString[MAXPATH]; /* String to hold server names. */ LPSTR szServerString = ServerString; @@ -922,7 +922,7 @@ void fillServersList(HWND hwndDlg) error = (NSGetServerList1)(NULL, &hServerList); if (error == NOERROR) { - + pServerList = (BYTE far *)(OSLockObject1)(hServerList); wServerCount = (WORD) *pServerList; @@ -933,7 +933,7 @@ void fillServersList(HWND hwndDlg) for (i=0; i> 8) ^ crc32_table[(crc & 0xFF) ^ buffer[i]]; - + // Exclusive OR the result with the beginning value. return crc^0xffffffff; } @@ -196,7 +196,7 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT& baseUrl, SERVLIST& arHashes) { REPLACEVARSARRAY vars[2]; vars[0].lptzKey = _T("platform"); - #ifdef WIN64 + #ifdef _WIN64 vars[0].lptzValue = _T("64"); #else vars[0].lptzValue = _T("32"); @@ -455,20 +455,20 @@ void __stdcall OpenPluginOptions(void*) // FUNCTION: IsRunAsAdmin() // -// PURPOSE: The function checks whether the current process is run as -// administrator. In other words, it dictates whether the primary access -// token of the process belongs to user account that is a member of the +// PURPOSE: The function checks whether the current process is run as +// administrator. In other words, it dictates whether the primary access +// token of the process belongs to user account that is a member of the // local Administrators group and it is elevated. // -// RETURN VALUE: Returns TRUE if the primary access token of the process -// belongs to user account that is a member of the local Administrators +// RETURN VALUE: Returns TRUE if the primary access token of the process +// belongs to user account that is a member of the local Administrators // group and it is elevated. Returns FALSE if the token does not. // -// EXCEPTION: If this function fails, it throws a C++ DWORD exception which +// EXCEPTION: If this function fails, it throws a C++ DWORD exception which // contains the Win32 error code of the failure. // // EXAMPLE CALL: -// try +// try // { // if (IsRunAsAdmin()) // wprintf (L"Process is run as administrator\n"); @@ -489,18 +489,18 @@ BOOL IsRunAsAdmin() // Allocate and initialize a SID of the administrators group. SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; if (!AllocateAndInitializeSid( - &NtAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, + &NtAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, &pAdministratorsGroup)) { dwError = GetLastError(); goto Cleanup; } - // Determine whether the SID of administrators group is bEnabled in + // Determine whether the SID of administrators group is bEnabled in // the primary access token of the process. if (!CheckTokenMembership(NULL, pAdministratorsGroup, &fIsRunAsAdmin)) { @@ -528,32 +528,32 @@ Cleanup: // // FUNCTION: IsProcessElevated() // -// PURPOSE: The function gets the elevation information of the current -// process. It dictates whether the process is elevated or not. Token -// elevation is only available on Windows Vista and newer operating -// systems, thus IsProcessElevated throws a C++ exception if it is called -// on systems prior to Windows Vista. It is not appropriate to use this +// PURPOSE: The function gets the elevation information of the current +// process. It dictates whether the process is elevated or not. Token +// elevation is only available on Windows Vista and newer operating +// systems, thus IsProcessElevated throws a C++ exception if it is called +// on systems prior to Windows Vista. It is not appropriate to use this // function to determine whether a process is run as administartor. // -// RETURN VALUE: Returns TRUE if the process is elevated. Returns FALSE if +// RETURN VALUE: Returns TRUE if the process is elevated. Returns FALSE if // it is not. // -// EXCEPTION: If this function fails, it throws a C++ DWORD exception -// which contains the Win32 error code of the failure. For example, if -// IsProcessElevated is called on systems prior to Windows Vista, the error +// EXCEPTION: If this function fails, it throws a C++ DWORD exception +// which contains the Win32 error code of the failure. For example, if +// IsProcessElevated is called on systems prior to Windows Vista, the error // code will be ERROR_INVALID_PARAMETER. // -// NOTE: TOKEN_INFORMATION_CLASS provides TokenElevationType to check the +// NOTE: TOKEN_INFORMATION_CLASS provides TokenElevationType to check the // elevation type (TokenElevationTypeDefault / TokenElevationTypeLimited / -// TokenElevationTypeFull) of the process. It is different from -// TokenElevation in that, when UAC is turned off, elevation type always -// returns TokenElevationTypeDefault even though the process is elevated -// (Integrity Level == High). In other words, it is not safe to say if the -// process is elevated based on elevation type. Instead, we should use +// TokenElevationTypeFull) of the process. It is different from +// TokenElevation in that, when UAC is turned off, elevation type always +// returns TokenElevationTypeDefault even though the process is elevated +// (Integrity Level == High). In other words, it is not safe to say if the +// process is elevated based on elevation type. Instead, we should use // TokenElevation. // // EXAMPLE CALL: -// try +// try // { // if (IsProcessElevated()) // wprintf (L"Process is elevated\n"); @@ -583,9 +583,9 @@ BOOL IsProcessElevated() DWORD dwSize; if (!GetTokenInformation(hToken, TokenElevation, &elevation, sizeof(elevation), &dwSize)) { - // When the process is run on operating systems prior to Windows - // Vista, GetTokenInformation returns FALSE with the - // ERROR_INVALID_PARAMETER error code because TokenElevation is + // When the process is run on operating systems prior to Windows + // Vista, GetTokenInformation returns FALSE with the + // ERROR_INVALID_PARAMETER error code because TokenElevation is // not supported on those operating systems. dwError = GetLastError(); goto Cleanup; @@ -630,7 +630,7 @@ int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2) else *dst++ = 0; DWORD dwBytes = 0, dwError; - if ( WriteFile(hPipe, buf, (DWORD)((BYTE*)dst - buf), &dwBytes, NULL) == 0) + if ( WriteFile(hPipe, buf, (DWORD)((BYTE*)dst - buf), &dwBytes, NULL) == 0) return 0; dwError = 0; -- cgit v1.2.3