diff options
| author | George Hazan <george.hazan@gmail.com> | 2016-07-25 10:31:04 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2016-07-25 10:31:04 +0000 | 
| commit | 8ae3679aa1339ce9abee53adb69902bd6b7513dc (patch) | |
| tree | 94ef8927e12043ed6dcc15e1e640d68a8add520e /plugins/ShellExt/src | |
| parent | 1e273e28d89b5838e3d0f0cafac9676577cb71ce (diff) | |
hello, Unix.
phase 1: removing _T()
git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ShellExt/src')
| -rw-r--r-- | plugins/ShellExt/src/main.cpp | 10 | ||||
| -rw-r--r-- | plugins/ShellExt/src/options.cpp | 2 | ||||
| -rw-r--r-- | plugins/ShellExt/src/shlcom.cpp | 38 | ||||
| -rw-r--r-- | plugins/ShellExt/src/utils.cpp | 2 | 
4 files changed, 26 insertions, 26 deletions
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index b4d4b09ef1..83d5842fb2 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -28,7 +28,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID)  		bIsVistaPlus = GetProcAddress( GetModuleHandleA("kernel32.dll"), "GetProductInfo") != NULL;
  		GetTempPath(_countof(tszLogPath), tszLogPath);
 -		_tcscat_s(tszLogPath, _countof(tszLogPath), _T("shlext.log"));
 +		_tcscat_s(tszLogPath, _countof(tszLogPath), L"shlext.log");
  		hInst = hinstDLL;
  		DisableThreadLibraryCalls(hinstDLL);
 @@ -102,7 +102,7 @@ char str4[] = "Apartment";  STDAPI DllRegisterServer()
  {
 -	HRegKey k1(HKEY_CLASSES_ROOT, _T("miranda.shlext"));
 +	HRegKey k1(HKEY_CLASSES_ROOT, L"miranda.shlext");
  	if (k1 == NULL)
  		return E_FAIL;
 @@ -114,7 +114,7 @@ STDAPI DllRegisterServer()  	//////////////////////////////////////////////////////////////////////////////////////
 -	HRegKey kClsid(HKEY_CLASSES_ROOT, _T("CLSID\\{72013A26-A94C-11d6-8540-A5E62932711D}"));
 +	HRegKey kClsid(HKEY_CLASSES_ROOT, L"CLSID\\{72013A26-A94C-11d6-8540-A5E62932711D}");
  	if (kClsid == NULL)
  		return E_FAIL;
 @@ -123,7 +123,7 @@ STDAPI DllRegisterServer()  	if ( RegSetValueA(kClsid, "ProgID", REG_SZ, str3, sizeof(str3)))
  		return E_FAIL;
 -	HRegKey kInprocServer(kClsid, _T("InprocServer32"));
 +	HRegKey kInprocServer(kClsid, L"InprocServer32");
  	if (kInprocServer == NULL)
  		return E_FAIL;
 @@ -143,7 +143,7 @@ STDAPI DllRegisterServer()  	//////////////////////////////////////////////////////////////////////////////////////
 -	HRegKey k2(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"));
 +	HRegKey k2(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved");
  	if (k2 == NULL)
  		return E_FAIL;
  	if ( RegSetValueExA(k2, str2, 0, REG_SZ, (PBYTE)str1, str1len))
 diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index 9fdb3d2204..0a0c837ee4 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -30,7 +30,7 @@ static void InitControls(HWND hwndDlg)  	int comReg = IsCOMRegistered();
  	TCHAR szBuf[MAX_PATH];
 -	mir_sntprintf(szBuf, _T("%s (%s)"),
 +	mir_sntprintf(szBuf, L"%s (%s)",
  		TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
  		TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
  	SetDlgItemText(hwndDlg, IDC_STATUS, szBuf);
 diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 07b74efd20..17915853ec 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -27,14 +27,14 @@ int IsCOMRegistered()  	int  res = 0;
  	// these arent the BEST checks in the world
 -	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRegKey)) {
 +	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"miranda.shlext", 0, KEY_READ, &hRegKey)) {
  		res += COMREG_OK;
  		RegCloseKey(hRegKey);
  	}
 -	if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_READ, &hRegKey)) {
 +	if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", 0, KEY_READ, &hRegKey)) {
  		DWORD lpType = REG_SZ;
 -		if (!RegQueryValueEx(hRegKey, _T("{72013A26-A94C-11d6-8540-A5E62932711D}"), NULL, &lpType, 0, 0))
 +		if (!RegQueryValueEx(hRegKey, L"{72013A26-A94C-11d6-8540-A5E62932711D}", NULL, &lpType, 0, 0))
  			res += COMREG_APPROVED;
  		RegCloseKey(hRegKey);
  	}
 @@ -509,33 +509,33 @@ void InvokeThreadServer()  HRESULT RemoveCOMRegistryEntries()
  {
  	HKEY hRootKey;
 -	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRootKey)) {
 +	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"miranda.shlext", 0, KEY_READ, &hRootKey)) {
  		// need to delete the subkey before the parent key is deleted under NT/2000/XP
 -		RegDeleteKey(hRootKey, _T("CLSID"));
 +		RegDeleteKey(hRootKey, L"CLSID");
  		// close the key
  		RegCloseKey(hRootKey);
  		// delete it
 -		if (RegDeleteKey(HKEY_CLASSES_ROOT, _T("miranda.shlext")) != ERROR_SUCCESS)
 +		if (RegDeleteKey(HKEY_CLASSES_ROOT, L"miranda.shlext") != ERROR_SUCCESS)
  			MessageBox(0,
  				TranslateT("Unable to delete registry key for 'shlext COM', this key may already be deleted or you may need admin rights."),
  				TranslateT("Problem"), MB_ICONERROR);
  	}
 -	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("\\*\\shellex\\ContextMenuHandlers"), 0, KEY_ALL_ACCESS, &hRootKey)) {
 -		if (RegDeleteKey(hRootKey, _T("miranda.shlext")) != ERROR_SUCCESS)
 +	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"\\*\\shellex\\ContextMenuHandlers", 0, KEY_ALL_ACCESS, &hRootKey)) {
 +		if (RegDeleteKey(hRootKey, L"miranda.shlext") != ERROR_SUCCESS)
  			MessageBox(0,
  				TranslateT("Unable to delete registry key for 'File context menu handlers', this key may already be deleted or you may need admin rights."),
  				TranslateT("Problem"), MB_ICONERROR);
  		RegCloseKey(hRootKey);
  	}
 -	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("Directory\\shellex\\ContextMenuHandlers"), 0, KEY_ALL_ACCESS, &hRootKey)) {
 -		if (RegDeleteKey(hRootKey, _T("miranda.shlext")) != ERROR_SUCCESS)
 +	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"Directory\\shellex\\ContextMenuHandlers", 0, KEY_ALL_ACCESS, &hRootKey)) {
 +		if (RegDeleteKey(hRootKey, L"miranda.shlext") != ERROR_SUCCESS)
  			MessageBox(0,
  				TranslateT("Unable to delete registry key for 'Directory context menu handlers', this key may already be deleted or you may need admin rights."),
  				TranslateT("Problem"), MB_ICONERROR);
  		RegCloseKey(hRootKey);
  	}
 -	if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_ALL_ACCESS, &hRootKey)) {
 -		if (RegDeleteValue(hRootKey, _T("{72013A26-A94C-11d6-8540-A5E62932711D}")) != ERROR_SUCCESS) {
 +	if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", 0, KEY_ALL_ACCESS, &hRootKey)) {
 +		if (RegDeleteValue(hRootKey, L"{72013A26-A94C-11d6-8540-A5E62932711D}") != ERROR_SUCCESS) {
  			MessageBox(0,
  				TranslateT("Unable to delete registry entry for 'Approved context menu handlers', this key may already be deleted or you may need admin rights."),
  				TranslateT("Problem"), MB_ICONERROR);
 @@ -552,11 +552,11 @@ void CheckUnregisterServer()  		// launches regsvr to remove the dll under admin.
  		TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
  		GetModuleFileName(hInst, szFileName, _countof(szFileName));
 -		mir_sntprintf(szBuf, _T("/s /u \"%s\""), szFileName);
 +		mir_sntprintf(szBuf, L"/s /u \"%s\"", szFileName);
  		SHELLEXECUTEINFO sei = { sizeof(sei) };
 -		sei.lpVerb = _T("runas");
 -		sei.lpFile = _T("regsvr32");
 +		sei.lpVerb = L"runas";
 +		sei.lpFile = L"regsvr32";
  		sei.lpParameters = szBuf;
  		if (ShellExecuteEx(&sei) == TRUE)
  			return;
 @@ -573,7 +573,7 @@ void CheckRegisterServer()  	TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
  	HKEY hRegKey;
 -	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRegKey))
 +	if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"miranda.shlext", 0, KEY_READ, &hRegKey))
  		RegCloseKey(hRegKey);
  	else if (bIsVistaPlus) {
  		MessageBox(0,
 @@ -581,11 +581,11 @@ void CheckRegisterServer()  			TranslateT("Miranda NG - Shell context menus (shellext.dll)"), MB_OK | MB_ICONINFORMATION);
  		// /s = silent
  		GetModuleFileName(hInst, szFileName, _countof(szFileName));
 -		mir_sntprintf(szBuf, _T("/s \"%s\""), szFileName);
 +		mir_sntprintf(szBuf, L"/s \"%s\"", szFileName);
  		SHELLEXECUTEINFO sei = { sizeof(sei) };
 -		sei.lpVerb = _T("runas");
 -		sei.lpFile = _T("regsvr32");
 +		sei.lpVerb = L"runas";
 +		sei.lpFile = L"regsvr32";
  		sei.lpParameters = szBuf;
  		ShellExecuteEx(&sei);
  	}
 diff --git a/plugins/ShellExt/src/utils.cpp b/plugins/ShellExt/src/utils.cpp index 22e033fb42..834850073d 100644 --- a/plugins/ShellExt/src/utils.cpp +++ b/plugins/ShellExt/src/utils.cpp @@ -5,7 +5,7 @@ extern TCHAR tszLogPath[];  void logA(const char *format, ...)
  {
 -	FILE *out = _tfopen(tszLogPath, _T("a+"));
 +	FILE *out = _tfopen(tszLogPath, L"a+");
  	if (out) {
  		va_list args;
  		va_start(args, format);
  | 
