From f6ad8bd613cb548766d50471d8e31431e28c0384 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 20 Mar 2015 13:18:36 +0000 Subject: [PATCH 001/135] libatl added. The work on al_import.exe continues. Aesthetic modifications --- atl.vcxproj | 114 +++++++++++++++++++++ atl.vcxproj.filters | 32 ++++++ atlcrypt.h | 51 ++++++++++ atlmsi.h | 241 ++++++++++++++++++++++++++++++++++++++++++++ atlwin.h | 65 ++++++++++++ stdafx.cpp | 20 ++++ stdafx.h | 25 +++++ 7 files changed, 548 insertions(+) create mode 100644 atl.vcxproj create mode 100644 atl.vcxproj.filters create mode 100644 atlcrypt.h create mode 100644 atlmsi.h create mode 100644 atlwin.h create mode 100644 stdafx.cpp create mode 100644 stdafx.h diff --git a/atl.vcxproj b/atl.vcxproj new file mode 100644 index 0000000..90dd211 --- /dev/null +++ b/atl.vcxproj @@ -0,0 +1,114 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libatl + {5A4EADF2-3237-457A-9DA8-BB9942A91019} + libatl + Win32Proj + + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + + + + + + + X64 + + + + + + + + + X64 + + + + + + Create + Create + Create + Create + + + + + + + + + + + + \ No newline at end of file diff --git a/atl.vcxproj.filters b/atl.vcxproj.filters new file mode 100644 index 0000000..83d005e --- /dev/null +++ b/atl.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/atlcrypt.h b/atlcrypt.h new file mode 100644 index 0000000..d6fba7e --- /dev/null +++ b/atlcrypt.h @@ -0,0 +1,51 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include +#include + + +inline DWORD CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, ATL::CAtlStringA &sNameString) +{ + // Query the final string length first. + DWORD dwSize = ::CertGetNameStringA(pCertContext, dwType, dwFlags, pvTypePara, NULL, 0); + + // Prepare the buffer to format the string data into and read it. + LPSTR szBuffer = sNameString.GetBuffer(dwSize); + if (!szBuffer) return ERROR_OUTOFMEMORY; + dwSize = ::CertGetNameStringA(pCertContext, dwType, dwFlags, pvTypePara, szBuffer, dwSize); + sNameString.ReleaseBuffer(dwSize); + return dwSize; +} + + +inline DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, void *pvTypePara, ATL::CAtlStringW &sNameString) +{ + // Query the final string length first. + DWORD dwSize = ::CertGetNameStringW(pCertContext, dwType, dwFlags, pvTypePara, NULL, 0); + + // Prepare the buffer to format the string data into and read it. + LPWSTR szBuffer = sNameString.GetBuffer(dwSize); + if (!szBuffer) return ERROR_OUTOFMEMORY; + dwSize = ::CertGetNameStringW(pCertContext, dwType, dwFlags, pvTypePara, szBuffer, dwSize); + sNameString.ReleaseBuffer(dwSize); + return dwSize; +} diff --git a/atlmsi.h b/atlmsi.h new file mode 100644 index 0000000..875d44e --- /dev/null +++ b/atlmsi.h @@ -0,0 +1,241 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include +#include +#include + + +inline UINT MsiGetPropertyA(MSIHANDLE hInstall, LPCSTR szName, ATL::CAtlStringA &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the actual string length first. + uiResult = ::MsiGetPropertyA(hInstall, szName, "", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to read the string data into and read it. + LPSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiGetPropertyA(hInstall, szName, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The string in database is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiGetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, ATL::CAtlStringW &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the actual string length first. + uiResult = ::MsiGetPropertyW(hInstall, szName, L"", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to read the string data into and read it. + LPWSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiGetPropertyW(hInstall, szName, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The string in database is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiRecordGetStringA(MSIHANDLE hRecord, unsigned int iField, ATL::CAtlStringA &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the actual string length first. + uiResult = ::MsiRecordGetStringA(hRecord, iField, "", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to read the string data into and read it. + LPSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiRecordGetStringA(hRecord, iField, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The string in database is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiRecordGetStringW(MSIHANDLE hRecord, unsigned int iField, ATL::CAtlStringW &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the actual string length first. + uiResult = ::MsiRecordGetStringW(hRecord, iField, L"", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to read the string data into and read it. + LPWSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiRecordGetStringW(hRecord, iField, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The string in database is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiFormatRecordA(MSIHANDLE hInstall, MSIHANDLE hRecord, ATL::CAtlStringA &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the final string length first. + uiResult = ::MsiFormatRecordA(hInstall, hRecord, "", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to format the string data into and read it. + LPSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiFormatRecordA(hInstall, hRecord, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The result is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, ATL::CAtlStringW &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the final string length first. + uiResult = ::MsiFormatRecordW(hInstall, hRecord, L"", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to format the string data into and read it. + LPWSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiFormatRecordW(hInstall, hRecord, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The result is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiRecordReadStream(MSIHANDLE hRecord, unsigned int iField, ATL::CAtlArray &binData) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the actual data length first. + uiResult = ::MsiRecordReadStream(hRecord, iField, NULL, &dwSize); + if (uiResult == NO_ERROR) { + if (!binData.SetCount(dwSize)) return ERROR_OUTOFMEMORY; + return ::MsiRecordReadStream(hRecord, iField, (char*)binData.GetData(), &dwSize); + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiGetTargetPathA(MSIHANDLE hInstall, LPCSTR szFolder, ATL::CAtlStringA &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the final string length first. + uiResult = ::MsiGetTargetPathA(hInstall, szFolder, "", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to format the string data into and read it. + LPSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiGetTargetPathA(hInstall, szFolder, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The result is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} + + +inline UINT MsiGetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, ATL::CAtlStringW &sValue) +{ + DWORD dwSize = 0; + UINT uiResult; + + // Query the final string length first. + uiResult = ::MsiGetTargetPathW(hInstall, szFolder, L"", &dwSize); + if (uiResult == ERROR_MORE_DATA) { + // Prepare the buffer to format the string data into and read it. + LPWSTR szBuffer = sValue.GetBuffer(dwSize++); + if (!szBuffer) return ERROR_OUTOFMEMORY; + uiResult = ::MsiGetTargetPathW(hInstall, szFolder, szBuffer, &dwSize); + sValue.ReleaseBuffer(uiResult == NO_ERROR ? dwSize : 0); + return uiResult; + } else if (uiResult == NO_ERROR) { + // The result is empty. + sValue.Empty(); + return NO_ERROR; + } else { + // Return error code. + return uiResult; + } +} diff --git a/atlwin.h b/atlwin.h new file mode 100644 index 0000000..2c6d877 --- /dev/null +++ b/atlwin.h @@ -0,0 +1,65 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include +#include + + +inline int GetWindowTextA(__in HWND hWnd, __out ATL::CAtlStringA &sValue) +{ + int iResult; + + // Query the final string length first. + iResult = ::GetWindowTextLengthA(hWnd); + if (iResult > 0) { + // Prepare the buffer to format the string data into and read it. + LPSTR szBuffer = sValue.GetBuffer(iResult++); + if (!szBuffer) return 0; + iResult = ::GetWindowTextA(hWnd, szBuffer, iResult); + sValue.ReleaseBuffer(iResult); + return iResult; + } else { + // The result is empty. + sValue.Empty(); + return 0; + } +} + + +inline int GetWindowTextW(__in HWND hWnd, __out ATL::CAtlStringW &sValue) +{ + int iResult; + + // Query the final string length first. + iResult = ::GetWindowTextLengthW(hWnd); + if (iResult > 0) { + // Prepare the buffer to format the string data into and read it. + LPWSTR szBuffer = sValue.GetBuffer(iResult++); + if (!szBuffer) return 0; + iResult = ::GetWindowTextW(hWnd, szBuffer, iResult); + sValue.ReleaseBuffer(iResult); + return iResult; + } else { + // The result is empty. + sValue.Empty(); + return 0; + } +} diff --git a/stdafx.cpp b/stdafx.cpp new file mode 100644 index 0000000..81111ac --- /dev/null +++ b/stdafx.cpp @@ -0,0 +1,20 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#include "stdafx.h" diff --git a/stdafx.h b/stdafx.h new file mode 100644 index 0000000..f2ab7f7 --- /dev/null +++ b/stdafx.h @@ -0,0 +1,25 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include "atlwin.h" + +#include "atlcrypt.h" +#include "atlmsi.h" From 03bf4dda554fe0ebcfdd54bb0ea4efe36acdef9d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 20 Mar 2015 13:19:01 +0000 Subject: [PATCH 002/135] libatl added. Aesthetic modifications From f95b10d5e3020941b7fdf3d6dc50fca36c4c9b7c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 24 Mar 2015 14:10:49 +0000 Subject: [PATCH 003/135] Additional functions added. --- atl.vcxproj | 1 + atl.vcxproj.filters | 3 ++ atlwin.h | 116 ++++++++++++++++++++++++++++++++++++++++++++ atlwlan.h | 51 +++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 atlwlan.h diff --git a/atl.vcxproj b/atl.vcxproj index 90dd211..6036d3c 100644 --- a/atl.vcxproj +++ b/atl.vcxproj @@ -106,6 +106,7 @@ + diff --git a/atl.vcxproj.filters b/atl.vcxproj.filters index 83d005e..0f178db 100644 --- a/atl.vcxproj.filters +++ b/atl.vcxproj.filters @@ -28,5 +28,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/atlwin.h b/atlwin.h index 2c6d877..383c3f0 100644 --- a/atlwin.h +++ b/atlwin.h @@ -63,3 +63,119 @@ inline int GetWindowTextW(__in HWND hWnd, __out ATL::CAtlStringW &sValue) return 0; } } + + +inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Inout_ ATL::CAtlStringA &sValue) +{ + DWORD dwSize = 0; + DWORD dwType; + + // Determine the type and size first. + if (::RegQueryValueExA(hReg, pszName, NULL, &dwType, NULL, &dwSize) == ERROR_SUCCESS) { + if (dwType == REG_SZ || dwType == REG_MULTI_SZ) { + // The value is REG_SZ or REG_MULTI_SZ. Read it now. + LPSTR szTemp = sValue.GetBuffer(dwSize / sizeof(TCHAR)); + if (::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { + sValue.ReleaseBuffer(); + return TRUE; + } else { + // Reading of the value failed. + sValue.ReleaseBuffer(0); + return FALSE; + } + } else if (dwType == REG_EXPAND_SZ) { + // The value is REG_EXPAND_SZ. Read it and expand environment variables. + LPSTR szTemp = (LPSTR)::LocalAlloc(LMEM_FIXED, dwSize); + if (!szTemp) AtlThrow(E_OUTOFMEMORY); + if (::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { + // The value was read successfully. Now, expand the environment variables. + DWORD cCharFinal = dwSize / sizeof(TCHAR) + 0x100; // Initial estimate + + for (;;) { + DWORD cCharEx = cCharFinal; + LPSTR szTempEx = sValue.GetBuffer(cCharEx); + cCharFinal = ::ExpandEnvironmentStringsA(szTemp, szTempEx, cCharEx); + if (cCharFinal > cCharEx) { + // The buffer was to small. Repeat with a bigger one. + sValue.ReleaseBuffer(0); + } else { + // The buffer was sufficient. Break. + sValue.ReleaseBuffer(); + break; + } + } + + ::LocalFree(szTemp); + return TRUE; + } else { + // Reading of the value failed. + ::LocalFree(szTemp); + return FALSE; + } + } else { + // The value is not a string type. + return FALSE; + } + } else { + // The value with given name doesn't exist in this key. + return FALSE; + } +} + + +inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Inout_ ATL::CAtlStringW &sValue) +{ + DWORD dwSize = 0; + DWORD dwType; + + // Determine the type and size first. + if (::RegQueryValueExW(hReg, pszName, NULL, &dwType, NULL, &dwSize) == ERROR_SUCCESS) { + if (dwType == REG_SZ || dwType == REG_MULTI_SZ) { + // The value is REG_SZ or REG_MULTI_SZ. Read it now. + LPWSTR szTemp = sValue.GetBuffer(dwSize / sizeof(TCHAR)); + if (::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { + sValue.ReleaseBuffer(); + return TRUE; + } else { + // Reading of the value failed. + sValue.ReleaseBuffer(0); + return FALSE; + } + } else if (dwType == REG_EXPAND_SZ) { + // The value is REG_EXPAND_SZ. Read it and expand environment variables. + LPWSTR szTemp = (LPWSTR)::LocalAlloc(LMEM_FIXED, dwSize); + if (!szTemp) AtlThrow(E_OUTOFMEMORY); + if (::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { + // The value was read successfully. Now, expand the environment variables. + DWORD cCharFinal = dwSize / sizeof(TCHAR) + 0x100; // Initial estimate + + for (;;) { + DWORD cCharEx = cCharFinal; + LPWSTR szTempEx = sValue.GetBuffer(cCharEx); + cCharFinal = ::ExpandEnvironmentStringsW(szTemp, szTempEx, cCharEx); + if (cCharFinal > cCharEx) { + // The buffer was to small. Repeat with a bigger one. + sValue.ReleaseBuffer(0); + } else { + // The buffer was sufficient. Break. + sValue.ReleaseBuffer(); + break; + } + } + + ::LocalFree(szTemp); + return TRUE; + } else { + // Reading of the value failed. + ::LocalFree(szTemp); + return FALSE; + } + } else { + // The value is not a string type. + return FALSE; + } + } else { + // The value with given name doesn't exist in this key. + return FALSE; + } +} diff --git a/atlwlan.h b/atlwlan.h new file mode 100644 index 0000000..fc72776 --- /dev/null +++ b/atlwlan.h @@ -0,0 +1,51 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include +#include + + +inline DWORD WlanReasonCodeToString(__in DWORD dwReasonCode, __out ATL::CAtlStringW &sValue, __reserved PVOID pReserved) +{ + DWORD dwSize = 0; + + for (;;) { + // Increment size and allocate buffer. + LPWSTR szBuffer = sValue.GetBuffer(dwSize += 1024); + if (!szBuffer) return ERROR_OUTOFMEMORY; + + // Try! + DWORD dwResult = ::WlanReasonCodeToString(dwReasonCode, dwSize, szBuffer, pReserved); + if (dwResult == NO_ERROR) { + DWORD dwLength = (DWORD)wcsnlen(szBuffer, dwSize); + sValue.ReleaseBuffer(dwLength); + if (dwLength < dwSize - 1) { + // Buffer was long enough to get entire string. + sValue.FreeExtra(); + return NO_ERROR; + } + } else { + // Return error code. + sValue.ReleaseBuffer(0); + return dwResult; + } + } +} From 84dfa43c6b9cb6fb3956d4062ecdbcab1ad4034c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 24 Mar 2015 14:13:25 +0000 Subject: [PATCH 004/135] From f36effe9e32bd5bcbb7b3f7507e748f1fd21d6a8 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 24 Mar 2015 14:14:14 +0000 Subject: [PATCH 005/135] From 62e847d47d14f87f5e6c54fb4f7dbe0369458a91 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 24 Mar 2015 14:14:28 +0000 Subject: [PATCH 006/135] al_import.exe finished. From 1bf4efa2231ec5fe24c69c63136be6ebe523d4e2 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 25 Mar 2015 09:03:35 +0000 Subject: [PATCH 007/135] Credential GUI was commented as not being used anymore. From cb032af25bb870e93967674bd1e404ca3e51a136 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 25 Mar 2015 13:34:17 +0000 Subject: [PATCH 008/135] From eba37ae9e460fc8589ba1b9e80f3f1f43d19dedb Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 25 Mar 2015 13:34:21 +0000 Subject: [PATCH 009/135] From 7afcf2d86a831646d72ae72cb89934e9d772dbd5 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 07:42:34 +0000 Subject: [PATCH 010/135] rcxgettext.exe updated to version 1.16. .arneslink-config-xml extension registration added. Aesthetic modifications From e375c033af91293325a69f4cc48047febf998243 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 08:57:02 +0000 Subject: [PATCH 011/135] Remember credentials on connect option reintroduced. Version set to 1.0-pre16. From 8600ebfef4e9db705f4e9b769f601e187082f702 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 08:57:14 +0000 Subject: [PATCH 012/135] From b66515f212b488dc7a9bd062eb8f1b51a153af31 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 08:57:15 +0000 Subject: [PATCH 013/135] TortoiseSVN auto commit: changed externals to fixed revision. From 834d7428fe62194b74ca35d3a6465174f6bbf4ea Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 08:57:15 +0000 Subject: [PATCH 014/135] TortoiseSVN auto commit: changed externals to fixed revision. From c4b0247d3e2de89a155f45663aabe9854dfb8dee Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 08:57:15 +0000 Subject: [PATCH 015/135] TortoiseSVN auto commit: changed externals to fixed revision. From b67f37719c3285208b3ad188e71d6cafb50dde19 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 08:57:15 +0000 Subject: [PATCH 016/135] TortoiseSVN auto commit: changed externals to fixed revision. From dce2e220f6017f8b62873b8a5481851339236525 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 13:41:14 +0000 Subject: [PATCH 017/135] Optional Server Authentication Extension of server certificate check removed. ServerID leaf of EAP Host XML configuration renamed to ServerName. encrypted attribute of element was superseded by encryption attribute, describing not only the encryption presence, but the encryption algorithm hint as well. From 38acdbd855d6cd7cd70cec28c636a862ad8e3874 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 27 Mar 2015 16:36:39 +0000 Subject: [PATCH 018/135] --- atlwin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atlwin.h b/atlwin.h index 383c3f0..30c3e25 100644 --- a/atlwin.h +++ b/atlwin.h @@ -30,7 +30,7 @@ inline int GetWindowTextA(__in HWND hWnd, __out ATL::CAtlStringA &sValue) // Query the final string length first. iResult = ::GetWindowTextLengthA(hWnd); if (iResult > 0) { - // Prepare the buffer to format the string data into and read it. + // Prepare the buffer and read the string data into it. LPSTR szBuffer = sValue.GetBuffer(iResult++); if (!szBuffer) return 0; iResult = ::GetWindowTextA(hWnd, szBuffer, iResult); @@ -51,7 +51,7 @@ inline int GetWindowTextW(__in HWND hWnd, __out ATL::CAtlStringW &sValue) // Query the final string length first. iResult = ::GetWindowTextLengthW(hWnd); if (iResult > 0) { - // Prepare the buffer to format the string data into and read it. + // Prepare the buffer and read the string data into it. LPWSTR szBuffer = sValue.GetBuffer(iResult++); if (!szBuffer) return 0; iResult = ::GetWindowTextW(hWnd, szBuffer, iResult); From b4144bcaea5cc881e08225925ec1865f2d01f122 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 30 Mar 2015 08:48:18 +0000 Subject: [PATCH 019/135] Added support for: GetModuleFileName() GetFileVersionInfo() PathCanonicalize() Aesthetic modifications --- atl.vcxproj | 1 + atl.vcxproj.filters | 3 ++ atlshlwapi.h | 53 +++++++++++++++++++++++ atlwin.h | 103 ++++++++++++++++++++++++++++++++++++++++++++ atlwlan.h | 9 ++-- 5 files changed, 166 insertions(+), 3 deletions(-) create mode 100644 atlshlwapi.h diff --git a/atl.vcxproj b/atl.vcxproj index 6036d3c..912d52c 100644 --- a/atl.vcxproj +++ b/atl.vcxproj @@ -105,6 +105,7 @@ + diff --git a/atl.vcxproj.filters b/atl.vcxproj.filters index 0f178db..037c86c 100644 --- a/atl.vcxproj.filters +++ b/atl.vcxproj.filters @@ -31,5 +31,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/atlshlwapi.h b/atlshlwapi.h new file mode 100644 index 0000000..76f9035 --- /dev/null +++ b/atlshlwapi.h @@ -0,0 +1,53 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include +#include + + +inline BOOL PathCanonicalizeA(__out ATL::CAtlStringA &sValue, __in LPCSTR pszPath) +{ + // Prepare the buffer data and read into it. + LPSTR szBuffer = sValue.GetBuffer(MAX_PATH); + if (!szBuffer) { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + BOOL bResult = ::PathCanonicalizeA(szBuffer, pszPath); + sValue.ReleaseBuffer(bResult ? strnlen(szBuffer, MAX_PATH) : 0); + sValue.FreeExtra(); + return bResult; +} + + +inline BOOL PathCanonicalizeW(__out ATL::CAtlStringW &sValue, __in LPCWSTR pszPath) +{ + // Prepare the buffer data and read into it. + LPWSTR szBuffer = sValue.GetBuffer(MAX_PATH); + if (!szBuffer) { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + BOOL bResult = ::PathCanonicalizeW(szBuffer, pszPath); + sValue.ReleaseBuffer(bResult ? wcsnlen(szBuffer, MAX_PATH) : 0); + sValue.FreeExtra(); + return bResult; +} diff --git a/atlwin.h b/atlwin.h index 30c3e25..e65ae62 100644 --- a/atlwin.h +++ b/atlwin.h @@ -19,10 +19,79 @@ #pragma once +#include #include #include +inline DWORD GetModuleFileNameA(__in_opt HMODULE hModule, __out ATL::CAtlStringA &sValue) +{ + DWORD dwSize = 0; + + for (;;) { + // Increment size and allocate buffer. + LPSTR szBuffer = sValue.GetBuffer(dwSize += 1024); + if (!szBuffer) { + ::SetLastError(ERROR_OUTOFMEMORY); + return 0; + } + + // Try! + DWORD dwResult = ::GetModuleFileNameA(hModule, szBuffer, dwSize); + if (dwResult == 0) { + // Error. + sValue.ReleaseBuffer(0); + return 0; + } else if (dwResult < dwSize) { + DWORD dwLength = (DWORD)strnlen(szBuffer, dwSize); + sValue.ReleaseBuffer(dwLength++); + if (dwLength == dwSize) { + // Buffer was long exactly enough. + return dwResult; + } if (dwLength < dwSize) { + // Buffer was long enough to get entire string, and has some extra space left. + sValue.FreeExtra(); + return dwResult; + } + } + } +} + + +inline DWORD GetModuleFileNameW(__in_opt HMODULE hModule, __out ATL::CAtlStringW &sValue) +{ + DWORD dwSize = 0; + + for (;;) { + // Increment size and allocate buffer. + LPWSTR szBuffer = sValue.GetBuffer(dwSize += 1024); + if (!szBuffer) { + ::SetLastError(ERROR_OUTOFMEMORY); + return 0; + } + + // Try! + DWORD dwResult = ::GetModuleFileNameW(hModule, szBuffer, dwSize); + if (dwResult == 0) { + // Error. + sValue.ReleaseBuffer(0); + return 0; + } else if (dwResult < dwSize) { + DWORD dwLength = (DWORD)wcsnlen(szBuffer, dwSize); + sValue.ReleaseBuffer(dwLength++); + if (dwLength == dwSize) { + // Buffer was long exactly enough. + return dwResult; + } if (dwLength < dwSize) { + // Buffer was long enough to get entire string, and has some extra space left. + sValue.FreeExtra(); + return dwResult; + } + } + } +} + + inline int GetWindowTextA(__in HWND hWnd, __out ATL::CAtlStringA &sValue) { int iResult; @@ -65,6 +134,40 @@ inline int GetWindowTextW(__in HWND hWnd, __out ATL::CAtlStringW &sValue) } +inline BOOL GetFileVersionInfoA(__in LPCSTR lptstrFilename, __reserved DWORD dwHandle, __out ATL::CAtlArray &aValue) +{ + // Get version info size. + DWORD dwVerInfoSize = ::GetFileVersionInfoSizeA(lptstrFilename, &dwHandle); + if (dwVerInfoSize != 0) { + if (aValue.SetCount(dwVerInfoSize)) { + // Read version info. + return ::GetFileVersionInfoA(lptstrFilename, dwHandle, dwVerInfoSize, aValue.GetData()); + } else { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + } else + return FALSE; +} + + +inline BOOL GetFileVersionInfoW(__in LPCWSTR lptstrFilename, __reserved DWORD dwHandle, __out ATL::CAtlArray &aValue) +{ + // Get version info size. + DWORD dwVerInfoSize = ::GetFileVersionInfoSizeW(lptstrFilename, &dwHandle); + if (dwVerInfoSize != 0) { + if (aValue.SetCount(dwVerInfoSize)) { + // Read version info. + return ::GetFileVersionInfoW(lptstrFilename, dwHandle, dwVerInfoSize, aValue.GetData()); + } else { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + } else + return FALSE; +} + + inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Inout_ ATL::CAtlStringA &sValue) { DWORD dwSize = 0; diff --git a/atlwlan.h b/atlwlan.h index fc72776..3d5be95 100644 --- a/atlwlan.h +++ b/atlwlan.h @@ -36,9 +36,12 @@ inline DWORD WlanReasonCodeToString(__in DWORD dwReasonCode, __out ATL::CAtlStri DWORD dwResult = ::WlanReasonCodeToString(dwReasonCode, dwSize, szBuffer, pReserved); if (dwResult == NO_ERROR) { DWORD dwLength = (DWORD)wcsnlen(szBuffer, dwSize); - sValue.ReleaseBuffer(dwLength); - if (dwLength < dwSize - 1) { - // Buffer was long enough to get entire string. + sValue.ReleaseBuffer(dwLength++); + if (dwLength == dwSize) { + // Buffer was long exactly enough. + return NO_ERROR; + } else if (dwLength < dwSize) { + // Buffer was long enough to get entire string, and has some extra space left. sValue.FreeExtra(); return NO_ERROR; } From abc162a17e6dd6087309bd23a3e374e4ea9fde7f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 30 Mar 2015 09:06:47 +0000 Subject: [PATCH 020/135] Path canonization added. MSI has problems with paths like: C:\Users\User\Documents\..\Projects etc. Aesthetic modifications Version set to 4.0-pre3. From 3ba16635d15e933f41af4e83e24de7e021926e49 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 Mar 2015 08:18:02 +0000 Subject: [PATCH 021/135] From bb11a9b32b32d2402ff3125244d459f96df3180a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 Mar 2015 09:19:38 +0000 Subject: [PATCH 022/135] Support for extension DLLs discontinued as not being maintained since SecureW2 fork. Several minor bug fixes. From b9b08c615089e7f6cccc07fe2b833b754c096920 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 Mar 2015 11:14:41 +0000 Subject: [PATCH 023/135] Code cleanup From 49f7c32c2e256df3667ce7758a514a2ce11d1099 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 Mar 2015 11:49:05 +0000 Subject: [PATCH 024/135] al_import.exe redesigned to support foreign WLAN configuration profile imports. Aesthetic modifications From 78b2a4339b21d544efea394daf92da8042de53da Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 Mar 2015 18:28:48 +0000 Subject: [PATCH 025/135] eduroam.si profile setup removed from MSI. The MSI files are now profile-independent. From 1b912b71191314ceb17855e119abccd12f33d022 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 Mar 2015 18:30:38 +0000 Subject: [PATCH 026/135] ALMSICA project removed as obsolete by transition to EAP Host XML configuration. From 0f6ae04cb516ed42908483ca7c50074e5eb1c79c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 06:21:52 +0000 Subject: [PATCH 027/135] Distinct - more descriptive - error message added, when WlanOpenHandle() returns ERROR_SERVICE_NOT_ACTIVE. Version set to 1.0-pre4. From 9bacbaf32b3f8808188116875b484f139c895bc9 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 06:26:25 +0000 Subject: [PATCH 028/135] The Setup.exe boot-strapper no longer requires elevation, since MSI takes care of that later. This way side-by-side MSI files get correctly loaded when started from network share or other user-dependant location. From d6f53bfe0e2d26bb889c7b0b84b004f918d6436e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 06:26:34 +0000 Subject: [PATCH 029/135] The Setup.exe boot-strapper no longer requires elevation, since MSI takes care of that later. This way side-by-side MSI files get correctly loaded when started from network share or other user-dependant location. From d6d404dbd87e1cc7a21ed83acc818198f4c6c7ad Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 07:14:54 +0000 Subject: [PATCH 030/135] From 5f6fd11b722b9447b56a7cb52c2679856d77a113 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 07:15:56 +0000 Subject: [PATCH 031/135] Version set to 1.0-pre17. From d84d53304da9bf29ad1e601048d24cc6f9d4e134 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 07:16:10 +0000 Subject: [PATCH 032/135] From e29d9bb049892ea0bf51a0603b986ca74db5e89f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 07:16:10 +0000 Subject: [PATCH 033/135] TortoiseSVN auto commit: changed externals to fixed revision. From a691afe3475b37f8646edec81966863169b2b02f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 07:16:11 +0000 Subject: [PATCH 034/135] TortoiseSVN auto commit: changed externals to fixed revision. From 01f6818bc3db5fd5a9cfc30c9f64e3f61b12101c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 07:16:11 +0000 Subject: [PATCH 035/135] TortoiseSVN auto commit: changed externals to fixed revision. From 79353bc3826af0afd827201fc9816b95aefceb37 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 1 Apr 2015 09:20:57 +0000 Subject: [PATCH 036/135] Aesthetic modifications From cbb1c91d552da0a7e03f46809527f0b5bb2b97aa Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 2 Apr 2015 08:26:17 +0000 Subject: [PATCH 037/135] Gradual code migration to ATL and object-oriented approach --- atlwin.h | 133 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 77 insertions(+), 56 deletions(-) diff --git a/atlwin.h b/atlwin.h index e65ae62..645b527 100644 --- a/atlwin.h +++ b/atlwin.h @@ -168,7 +168,66 @@ inline BOOL GetFileVersionInfoW(__in LPCWSTR lptstrFilename, __reserved DWORD dw } -inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Inout_ ATL::CAtlStringA &sValue) +inline DWORD ExpandEnvironmentStringsA(__in LPCSTR lpSrc, ATL::CAtlStringA &sValue) +{ + DWORD dwBufferSizeEst = (DWORD)strlen(lpSrc) + 0x100; // Initial estimate + + for (;;) { + DWORD dwBufferSize = dwBufferSizeEst; + LPSTR szBuffer = sValue.GetBuffer(dwBufferSize); + if (!szBuffer) { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + dwBufferSizeEst = ::ExpandEnvironmentStringsA(lpSrc, szBuffer, dwBufferSize); + if (dwBufferSizeEst > dwBufferSize) { + // The buffer was to small. Repeat with a bigger one. + sValue.ReleaseBuffer(0); + } else if (dwBufferSizeEst == 0) { + // Error. + sValue.ReleaseBuffer(0); + return 0; + } else { + // The buffer was sufficient. Break. + sValue.ReleaseBuffer(); + sValue.FreeExtra(); + return dwBufferSizeEst; + } + } +} + + +inline DWORD ExpandEnvironmentStringsW(__in LPCWSTR lpSrc, ATL::CAtlStringW &sValue) +{ + DWORD dwBufferSizeEst = (DWORD)wcslen(lpSrc) + 0x100; // Initial estimate + + for (;;) { + DWORD dwBufferSize = dwBufferSizeEst; + LPWSTR szBuffer = sValue.GetBuffer(dwBufferSize); + if (!szBuffer) { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + dwBufferSizeEst = ::ExpandEnvironmentStringsW(lpSrc, szBuffer, dwBufferSize); + if (dwBufferSizeEst > dwBufferSize) { + // The buffer was to small. Repeat with a bigger one. + sValue.ReleaseBuffer(0); + } else if (dwBufferSizeEst == 0) { + // Error. + sValue.ReleaseBuffer(0); + return 0; + } else { + // The buffer was sufficient. Break. + sValue.ReleaseBuffer(); + sValue.FreeExtra(); + return dwBufferSizeEst; + } + } +} + + + +inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Out_ ATL::CAtlStringA &sValue) { DWORD dwSize = 0; DWORD dwType; @@ -178,6 +237,10 @@ inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Inout_ A if (dwType == REG_SZ || dwType == REG_MULTI_SZ) { // The value is REG_SZ or REG_MULTI_SZ. Read it now. LPSTR szTemp = sValue.GetBuffer(dwSize / sizeof(TCHAR)); + if (!szTemp) { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } if (::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { sValue.ReleaseBuffer(); return TRUE; @@ -188,33 +251,10 @@ inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Inout_ A } } else if (dwType == REG_EXPAND_SZ) { // The value is REG_EXPAND_SZ. Read it and expand environment variables. - LPSTR szTemp = (LPSTR)::LocalAlloc(LMEM_FIXED, dwSize); - if (!szTemp) AtlThrow(E_OUTOFMEMORY); - if (::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { - // The value was read successfully. Now, expand the environment variables. - DWORD cCharFinal = dwSize / sizeof(TCHAR) + 0x100; // Initial estimate - - for (;;) { - DWORD cCharEx = cCharFinal; - LPSTR szTempEx = sValue.GetBuffer(cCharEx); - cCharFinal = ::ExpandEnvironmentStringsA(szTemp, szTempEx, cCharEx); - if (cCharFinal > cCharEx) { - // The buffer was to small. Repeat with a bigger one. - sValue.ReleaseBuffer(0); - } else { - // The buffer was sufficient. Break. - sValue.ReleaseBuffer(); - break; - } - } - - ::LocalFree(szTemp); - return TRUE; - } else { - // Reading of the value failed. - ::LocalFree(szTemp); - return FALSE; - } + ATL::CTempBuffer sTemp(dwSize / sizeof(CHAR)); + return + ::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)(CHAR*)sTemp, &dwSize) == ERROR_SUCCESS && + ::ExpandEnvironmentStringsA((const CHAR*)sTemp, sValue) != 0; } else { // The value is not a string type. return FALSE; @@ -226,7 +266,7 @@ inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Inout_ A } -inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Inout_ ATL::CAtlStringW &sValue) +inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Out_ ATL::CAtlStringW &sValue) { DWORD dwSize = 0; DWORD dwType; @@ -236,6 +276,10 @@ inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Inout_ if (dwType == REG_SZ || dwType == REG_MULTI_SZ) { // The value is REG_SZ or REG_MULTI_SZ. Read it now. LPWSTR szTemp = sValue.GetBuffer(dwSize / sizeof(TCHAR)); + if (!szTemp) { + ::SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } if (::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { sValue.ReleaseBuffer(); return TRUE; @@ -246,33 +290,10 @@ inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Inout_ } } else if (dwType == REG_EXPAND_SZ) { // The value is REG_EXPAND_SZ. Read it and expand environment variables. - LPWSTR szTemp = (LPWSTR)::LocalAlloc(LMEM_FIXED, dwSize); - if (!szTemp) AtlThrow(E_OUTOFMEMORY); - if (::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { - // The value was read successfully. Now, expand the environment variables. - DWORD cCharFinal = dwSize / sizeof(TCHAR) + 0x100; // Initial estimate - - for (;;) { - DWORD cCharEx = cCharFinal; - LPWSTR szTempEx = sValue.GetBuffer(cCharEx); - cCharFinal = ::ExpandEnvironmentStringsW(szTemp, szTempEx, cCharEx); - if (cCharFinal > cCharEx) { - // The buffer was to small. Repeat with a bigger one. - sValue.ReleaseBuffer(0); - } else { - // The buffer was sufficient. Break. - sValue.ReleaseBuffer(); - break; - } - } - - ::LocalFree(szTemp); - return TRUE; - } else { - // Reading of the value failed. - ::LocalFree(szTemp); - return FALSE; - } + ATL::CTempBuffer sTemp(dwSize / sizeof(WCHAR)); + return + ::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)(WCHAR*)sTemp, &dwSize) == ERROR_SUCCESS && + ::ExpandEnvironmentStringsW((const WCHAR*)sTemp, sValue) != 0; } else { // The value is not a string type. return FALSE; From 87116d344c454802fdfdfcfeb86340e1d08066e9 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 2 Apr 2015 16:22:37 +0000 Subject: [PATCH 038/135] Gradual code migration to ATL and object-oriented approach Code cleanup --- atlcrypt.h | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++ atlwin.h | 90 +++++++++++++++++++++++++----------------- 2 files changed, 166 insertions(+), 36 deletions(-) diff --git a/atlcrypt.h b/atlcrypt.h index d6fba7e..c3b28b6 100644 --- a/atlcrypt.h +++ b/atlcrypt.h @@ -49,3 +49,115 @@ inline DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD sNameString.ReleaseBuffer(dwSize); return dwSize; } + + +namespace ATL +{ + namespace Crypt + { + + // + // CCertContext + // + class CCertContext + { + public: + inline CCertContext() throw() : m_pCertContext(NULL) + { + } + + inline CCertContext(PCCERT_CONTEXT p) throw() : m_pCertContext(p) + { + } + + inline ~CCertContext() throw() + { + if (m_pCertContext) + CertFreeCertificateContext(m_pCertContext); + } + + inline operator PCCERT_CONTEXT() const throw() + { + return m_pCertContext; + } + + inline const CERT_CONTEXT& operator*() const + { + ATLENSURE(m_pCertContext != NULL); + return *m_pCertContext; + } + + inline PCCERT_CONTEXT* operator&() throw() + { + ATLASSERT(m_pCertContext == NULL); + return &m_pCertContext; + } + + inline PCCERT_CONTEXT operator->() const throw() + { + ATLASSERT(m_pCertContext != NULL); + return m_pCertContext; + } + + inline bool operator!() const throw() + { + return m_pCertContext == NULL; + } + + inline bool operator<(_In_opt_ PCCERT_CONTEXT p) const throw() + { + return m_pCertContext < p; + } + + inline bool operator!=(_In_opt_ PCCERT_CONTEXT p) const + { + return !operator==(p); + } + + inline bool operator==(_In_opt_ PCCERT_CONTEXT p) const throw() + { + return m_pCertContext == p; + } + + inline void Attach(_In_opt_ PCCERT_CONTEXT p) throw() + { + if (m_pCertContext) + CertFreeCertificateContext(m_pCertContext); + m_pCertContext = p; + } + + inline PCCERT_CONTEXT Detach() throw() + { + PCCERT_CONTEXT p = m_pCertContext; + m_pCertContext = NULL; + return p; + } + + inline BOOL Create(_In_ DWORD dwCertEncodingType, _In_ const BYTE *pbCertEncoded, _In_ DWORD cbCertEncoded) throw() + { + PCCERT_CONTEXT p; + + p = CertCreateCertificateContext(dwCertEncodingType, pbCertEncoded, cbCertEncoded); + if (!p) return FALSE; + + if (m_pCertContext) + CertFreeCertificateContext(m_pCertContext); + m_pCertContext = p; + return TRUE; + } + + inline BOOL Free() throw() + { + if (m_pCertContext) { + BOOL bResult = CertFreeCertificateContext(m_pCertContext); + m_pCertContext = NULL; + return bResult; + } else + return TRUE; + } + + protected: + PCCERT_CONTEXT m_pCertContext; + }; + } +} diff --git a/atlwin.h b/atlwin.h index 645b527..1a5261f 100644 --- a/atlwin.h +++ b/atlwin.h @@ -227,79 +227,97 @@ inline DWORD ExpandEnvironmentStringsW(__in LPCWSTR lpSrc, ATL::CAtlStringW &sVa -inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Out_ ATL::CAtlStringA &sValue) +inline LSTATUS RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Out_ ATL::CAtlStringA &sValue) { - DWORD dwSize = 0; - DWORD dwType; + LSTATUS lResult; + DWORD dwSize = 0, dwType; // Determine the type and size first. - if (::RegQueryValueExA(hReg, pszName, NULL, &dwType, NULL, &dwSize) == ERROR_SUCCESS) { + if ((lResult = ::RegQueryValueExA(hReg, pszName, NULL, &dwType, NULL, &dwSize)) == ERROR_SUCCESS) { if (dwType == REG_SZ || dwType == REG_MULTI_SZ) { // The value is REG_SZ or REG_MULTI_SZ. Read it now. LPSTR szTemp = sValue.GetBuffer(dwSize / sizeof(TCHAR)); - if (!szTemp) { - ::SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - if (::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { + if (!szTemp) return ERROR_OUTOFMEMORY; + if ((lResult = ::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize)) == ERROR_SUCCESS) { sValue.ReleaseBuffer(); - return TRUE; } else { // Reading of the value failed. sValue.ReleaseBuffer(0); - return FALSE; } } else if (dwType == REG_EXPAND_SZ) { // The value is REG_EXPAND_SZ. Read it and expand environment variables. ATL::CTempBuffer sTemp(dwSize / sizeof(CHAR)); - return - ::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)(CHAR*)sTemp, &dwSize) == ERROR_SUCCESS && - ::ExpandEnvironmentStringsA((const CHAR*)sTemp, sValue) != 0; + if ((lResult = ::RegQueryValueExA(hReg, pszName, NULL, NULL, (LPBYTE)(CHAR*)sTemp, &dwSize)) == ERROR_SUCCESS) + if (::ExpandEnvironmentStringsA((const CHAR*)sTemp, sValue) == 0) + lResult = ::GetLastError(); } else { // The value is not a string type. - return FALSE; + lResult = ERROR_INVALID_DATA; } - } else { - // The value with given name doesn't exist in this key. - return FALSE; } + + return lResult; } -inline BOOL RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Out_ ATL::CAtlStringW &sValue) +inline LSTATUS RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCWSTR pszName, _Out_ ATL::CAtlStringW &sValue) { - DWORD dwSize = 0; - DWORD dwType; + LSTATUS lResult; + DWORD dwSize = 0, dwType; // Determine the type and size first. - if (::RegQueryValueExW(hReg, pszName, NULL, &dwType, NULL, &dwSize) == ERROR_SUCCESS) { + if ((lResult = ::RegQueryValueExW(hReg, pszName, NULL, &dwType, NULL, &dwSize)) == ERROR_SUCCESS) { if (dwType == REG_SZ || dwType == REG_MULTI_SZ) { // The value is REG_SZ or REG_MULTI_SZ. Read it now. LPWSTR szTemp = sValue.GetBuffer(dwSize / sizeof(TCHAR)); - if (!szTemp) { - ::SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - if (::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize) == ERROR_SUCCESS) { + if (!szTemp) return ERROR_OUTOFMEMORY; + if ((lResult = ::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)szTemp, &dwSize)) == ERROR_SUCCESS) { sValue.ReleaseBuffer(); - return TRUE; } else { // Reading of the value failed. sValue.ReleaseBuffer(0); - return FALSE; } } else if (dwType == REG_EXPAND_SZ) { // The value is REG_EXPAND_SZ. Read it and expand environment variables. ATL::CTempBuffer sTemp(dwSize / sizeof(WCHAR)); - return - ::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)(WCHAR*)sTemp, &dwSize) == ERROR_SUCCESS && - ::ExpandEnvironmentStringsW((const WCHAR*)sTemp, sValue) != 0; + if ((lResult = ::RegQueryValueExW(hReg, pszName, NULL, NULL, (LPBYTE)(WCHAR*)sTemp, &dwSize)) == ERROR_SUCCESS) + if (::ExpandEnvironmentStringsW((const WCHAR*)sTemp, sValue) == 0) + lResult = ::GetLastError(); } else { // The value is not a string type. - return FALSE; + lResult = ERROR_INVALID_DATA; } - } else { - // The value with given name doesn't exist in this key. - return FALSE; } + + return lResult; +} + + +inline LSTATUS RegQueryValueExA(__in HKEY hKey, __in_opt LPCSTR lpValueName, __reserved LPDWORD lpReserved, __out_opt LPDWORD lpType, __out ATL::CAtlArray &aData) +{ + LSTATUS lResult; + DWORD dwDataSize; + + if ((lResult = RegQueryValueExA(hKey, lpValueName, lpReserved, NULL, NULL, &dwDataSize)) == ERROR_SUCCESS) { + if (!aData.SetCount(dwDataSize)) return ERROR_OUTOFMEMORY; + if ((lResult = RegQueryValueExA(hKey, lpValueName, lpReserved, lpType, aData.GetData(), &dwDataSize)) != ERROR_SUCCESS) + aData.SetCount(0); + } + + return lResult; +} + + +inline LSTATUS RegQueryValueExW(__in HKEY hKey, __in_opt LPCWSTR lpValueName, __reserved LPDWORD lpReserved, __out_opt LPDWORD lpType, __out ATL::CAtlArray &aData) +{ + LSTATUS lResult; + DWORD dwDataSize; + + if ((lResult = RegQueryValueExW(hKey, lpValueName, lpReserved, NULL, NULL, &dwDataSize)) == ERROR_SUCCESS) { + if (!aData.SetCount(dwDataSize)) return ERROR_OUTOFMEMORY; + if ((lResult = RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, aData.GetData(), &dwDataSize)) != ERROR_SUCCESS) + aData.SetCount(0); + } + + return lResult; } From ef017dfe52ce064ecce9783a787f39c0a260215e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 2 Apr 2015 16:22:49 +0000 Subject: [PATCH 039/135] From f4bf46a58fdbf5b4d72b87ed05fe04ac06e5ec5c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Apr 2015 09:05:43 +0000 Subject: [PATCH 040/135] Gradual code migration to ATL and object-oriented approach Code cleanup --- atl.vcxproj | 1 + atl.vcxproj.filters | 3 + atlcrypt.h | 215 ++++++++++++++++++++++++++------------------ atlex.h | 115 ++++++++++++++++++++++++ 4 files changed, 245 insertions(+), 89 deletions(-) create mode 100644 atlex.h diff --git a/atl.vcxproj b/atl.vcxproj index 912d52c..be2a208 100644 --- a/atl.vcxproj +++ b/atl.vcxproj @@ -104,6 +104,7 @@ + diff --git a/atl.vcxproj.filters b/atl.vcxproj.filters index 037c86c..37be935 100644 --- a/atl.vcxproj.filters +++ b/atl.vcxproj.filters @@ -34,5 +34,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/atlcrypt.h b/atlcrypt.h index c3b28b6..57e7b5b 100644 --- a/atlcrypt.h +++ b/atlcrypt.h @@ -19,6 +19,8 @@ #pragma once +#include "atlex.h" +#include #include #include @@ -51,113 +53,148 @@ inline DWORD CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD } +inline BOOL CryptGetHashParam(__in HCRYPTHASH hHash, __in DWORD dwParam, __out ATL::CAtlArray &aData, __in DWORD dwFlags) +{ + DWORD dwHashSize; + + if (CryptGetHashParam(hHash, dwParam, NULL, &dwHashSize, dwFlags)) { + if (aData.SetCount(dwHashSize)) { + if (CryptGetHashParam(hHash, dwParam, aData.GetData(), &dwHashSize, dwFlags)) { + return TRUE; + } else { + aData.SetCount(0); + return FALSE; + } + } else { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + } else + return FALSE; +} + + namespace ATL { namespace Crypt { - // // CCertContext // - class CCertContext + class CCertContext : public ATL::CHandleT { public: - inline CCertContext() throw() : m_pCertContext(NULL) + virtual ~CCertContext() throw() { - } - - inline CCertContext(PCCERT_CONTEXT p) throw() : m_pCertContext(p) - { - } - - inline ~CCertContext() throw() - { - if (m_pCertContext) - CertFreeCertificateContext(m_pCertContext); - } - - inline operator PCCERT_CONTEXT() const throw() - { - return m_pCertContext; - } - - inline const CERT_CONTEXT& operator*() const - { - ATLENSURE(m_pCertContext != NULL); - return *m_pCertContext; - } - - inline PCCERT_CONTEXT* operator&() throw() - { - ATLASSERT(m_pCertContext == NULL); - return &m_pCertContext; - } - - inline PCCERT_CONTEXT operator->() const throw() - { - ATLASSERT(m_pCertContext != NULL); - return m_pCertContext; - } - - inline bool operator!() const throw() - { - return m_pCertContext == NULL; - } - - inline bool operator<(_In_opt_ PCCERT_CONTEXT p) const throw() - { - return m_pCertContext < p; - } - - inline bool operator!=(_In_opt_ PCCERT_CONTEXT p) const - { - return !operator==(p); - } - - inline bool operator==(_In_opt_ PCCERT_CONTEXT p) const throw() - { - return m_pCertContext == p; - } - - inline void Attach(_In_opt_ PCCERT_CONTEXT p) throw() - { - if (m_pCertContext) - CertFreeCertificateContext(m_pCertContext); - m_pCertContext = p; - } - - inline PCCERT_CONTEXT Detach() throw() - { - PCCERT_CONTEXT p = m_pCertContext; - m_pCertContext = NULL; - return p; + if (m_h) + CertFreeCertificateContext(m_h); } inline BOOL Create(_In_ DWORD dwCertEncodingType, _In_ const BYTE *pbCertEncoded, _In_ DWORD cbCertEncoded) throw() { - PCCERT_CONTEXT p; - - p = CertCreateCertificateContext(dwCertEncodingType, pbCertEncoded, cbCertEncoded); - if (!p) return FALSE; - - if (m_pCertContext) - CertFreeCertificateContext(m_pCertContext); - m_pCertContext = p; - return TRUE; - } - - inline BOOL Free() throw() - { - if (m_pCertContext) { - BOOL bResult = CertFreeCertificateContext(m_pCertContext); - m_pCertContext = NULL; - return bResult; - } else + HANDLE h = CertCreateCertificateContext(dwCertEncodingType, pbCertEncoded, cbCertEncoded); + if (h) { + Attach(h); return TRUE; + } else + return FALSE; } protected: - PCCERT_CONTEXT m_pCertContext; + virtual void InternalFree() + { + CertFreeCertificateContext(m_h); + } + }; + + + // + // CCertStore + // + class CCertStore : public ATL::CHandleT + { + public: + virtual ~CCertStore() throw() + { + if (m_h) + CertCloseStore(m_h, 0); + } + + inline BOOL Create(__in LPCSTR lpszStoreProvider, __in DWORD dwEncodingType, __in_opt HCRYPTPROV_LEGACY hCryptProv, __in DWORD dwFlags, __in_opt const void *pvPara) throw() + { + HANDLE h = CertOpenStore(lpszStoreProvider, dwEncodingType, hCryptProv, dwFlags, pvPara); + if (h) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + protected: + virtual void InternalFree() + { + CertCloseStore(m_h, 0); + } + }; + + + // + // CContext + // + class CContext : public ATL::CHandleT + { + public: + virtual ~CContext() throw() + { + if (m_h) + CryptReleaseContext(m_h, 0); + } + + inline BOOL Create(__in_opt LPCTSTR szContainer, __in_opt LPCTSTR szProvider, __in DWORD dwProvType, __in DWORD dwFlags) throw() + { + HANDLE h; + if (CryptAcquireContext(&h, szContainer, szProvider, dwProvType, dwFlags)) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + protected: + virtual void InternalFree() + { + CryptReleaseContext(m_h, 0); + } + }; + + + // + // CHash + // + class CHash : public ATL::CHandleT + { + public: + virtual ~CHash() throw() + { + if (m_h) + CryptDestroyHash(m_h); + } + + inline BOOL Create(__in HCRYPTPROV hProv, __in ALG_ID Algid, __in HCRYPTKEY hKey, __in DWORD dwFlags) throw() + { + HANDLE h; + if (CryptCreateHash(hProv, Algid, hKey, dwFlags, &h)) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + protected: + virtual void InternalFree() + { + CryptDestroyHash(m_h); + } }; } } diff --git a/atlex.h b/atlex.h new file mode 100644 index 0000000..e0ae75d --- /dev/null +++ b/atlex.h @@ -0,0 +1,115 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include + + +namespace ATL +{ + // + // CHandleT + // + template + class CHandleT + { + public: + typedef T HANDLE; + + inline CHandleT() throw() : m_h(NULL) + { + } + + inline CHandleT(T h) throw() : m_h(h) + { + } + + inline operator T() const throw() + { + return m_h; + } + + inline T*& operator*() const + { + ATLENSURE(m_h != NULL); + return *m_h; + } + + inline T* operator&() throw() + { + ATLASSERT(m_h == NULL); + return &m_h; + } + + inline T operator->() const throw() + { + ATLASSERT(m_h != NULL); + return m_h; + } + + inline bool operator!() const throw() + { + return m_h == NULL; + } + + inline bool operator<(_In_opt_ T h) const throw() + { + return m_h < h; + } + + inline bool operator!=(_In_opt_ T h) const + { + return !operator==(h); + } + + inline bool operator==(_In_opt_ T h) const throw() + { + return m_h == h; + } + + inline void Attach(_In_opt_ T h) throw() + { + if (m_h) + InternalFree(); + m_h = h; + } + + inline T Detach() throw() + { + T h = m_h; + m_h = NULL; + return h; + } + + inline void Free() throw() + { + if (m_h) { + InternalFree(); + m_h = NULL; + } + } + + protected: + virtual void InternalFree() = 0; + + protected: + T m_h; + }; +} From d7310ae077ef1395a647dc8986cb06234a0ca18f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Apr 2015 09:36:07 +0000 Subject: [PATCH 041/135] Gradual code migration to ATL and object-oriented approach --- atlcrypt.h | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++--- atlex.h | 8 +++--- 2 files changed, 79 insertions(+), 8 deletions(-) diff --git a/atlcrypt.h b/atlcrypt.h index 57e7b5b..19c3d60 100644 --- a/atlcrypt.h +++ b/atlcrypt.h @@ -74,6 +74,27 @@ inline BOOL CryptGetHashParam(__in HCRYPTHASH hHash, __in DWORD dwParam, __out } +inline BOOL CryptExportKey(__in HCRYPTKEY hKey, __in HCRYPTKEY hExpKey, __in DWORD dwBlobType, __in DWORD dwFlags, __out ATL::CAtlArray &aData) +{ + DWORD dwKeyBLOBSize; + + if (CryptExportKey(hKey, hExpKey, dwBlobType, dwFlags, NULL, &dwKeyBLOBSize)) { + if (aData.SetCount(dwKeyBLOBSize)) { + if (CryptExportKey(hKey, hExpKey, dwBlobType, dwFlags, aData.GetData(), &dwKeyBLOBSize)) { + return TRUE; + } else { + aData.SetCount(0); + return FALSE; + } + } else { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + } else + return FALSE; +} + + namespace ATL { namespace Crypt @@ -81,7 +102,7 @@ namespace ATL // // CCertContext // - class CCertContext : public ATL::CHandleT + class CCertContext : public ATL::CObjectWithHandleT { public: virtual ~CCertContext() throw() @@ -111,7 +132,7 @@ namespace ATL // // CCertStore // - class CCertStore : public ATL::CHandleT + class CCertStore : public ATL::CObjectWithHandleT { public: virtual ~CCertStore() throw() @@ -141,7 +162,7 @@ namespace ATL // // CContext // - class CContext : public ATL::CHandleT + class CContext : public ATL::CObjectWithHandleT { public: virtual ~CContext() throw() @@ -171,7 +192,7 @@ namespace ATL // // CHash // - class CHash : public ATL::CHandleT + class CHash : public ATL::CObjectWithHandleT { public: virtual ~CHash() throw() @@ -196,5 +217,55 @@ namespace ATL CryptDestroyHash(m_h); } }; + + + // + // CKey + // + class CKey : public ATL::CObjectWithHandleT + { + public: + virtual ~CKey() throw() + { + if (m_h) + CryptDestroyKey(m_h); + } + + inline BOOL Generate(__in HCRYPTPROV hProv, __in ALG_ID Algid, __in DWORD dwFlags) throw() + { + HANDLE h; + if (CryptGenKey(hProv, Algid, dwFlags, &h)) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + inline BOOL Import(__in HCRYPTPROV hProv, __in_bcount(dwDataLen) CONST BYTE *pbData, __in DWORD dwDataLen, __in HCRYPTKEY hPubKey, __in DWORD dwFlags) throw() + { + HANDLE h; + if (CryptImportKey(hProv, pbData, dwDataLen, hPubKey, dwFlags, &h)) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + inline BOOL ImportPublic(__in HCRYPTPROV hCryptProv, __in DWORD dwCertEncodingType, __in PCERT_PUBLIC_KEY_INFO pInfo) throw() + { + HANDLE h; + if (CryptImportPublicKeyInfo(hCryptProv, dwCertEncodingType, pInfo, &h)) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + protected: + virtual void InternalFree() + { + CryptDestroyKey(m_h); + } + }; } } diff --git a/atlex.h b/atlex.h index e0ae75d..dc29262 100644 --- a/atlex.h +++ b/atlex.h @@ -25,19 +25,19 @@ namespace ATL { // - // CHandleT + // CObjectWithHandleT // template - class CHandleT + class CObjectWithHandleT { public: typedef T HANDLE; - inline CHandleT() throw() : m_h(NULL) + inline CObjectWithHandleT() throw() : m_h(NULL) { } - inline CHandleT(T h) throw() : m_h(h) + inline CObjectWithHandleT(T h) throw() : m_h(h) { } From a8bde1374112aa91d7cc253bd2c943ce560deb61 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Apr 2015 11:58:02 +0000 Subject: [PATCH 042/135] Gradual code migration to ATL and object-oriented approach From bc81d78c49648352491592ec5a8abadeb5a6ae5e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Apr 2015 12:46:16 +0000 Subject: [PATCH 043/135] From 35e590caac8960e7239e78e5018aa6232647925b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Apr 2015 12:46:29 +0000 Subject: [PATCH 044/135] From b51eb6d1bc86b0d07ddc08dd1652e9d9db789e48 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Apr 2015 12:49:49 +0000 Subject: [PATCH 045/135] From beaa51b49de0f09c38d18ef9ad5a90793672b754 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 5 Apr 2015 20:01:36 +0000 Subject: [PATCH 046/135] Support for file read&write of AL::TLS::CConfigData added. --- atlwin.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/atlwin.h b/atlwin.h index 1a5261f..651303b 100644 --- a/atlwin.h +++ b/atlwin.h @@ -101,7 +101,10 @@ inline int GetWindowTextA(__in HWND hWnd, __out ATL::CAtlStringA &sValue) if (iResult > 0) { // Prepare the buffer and read the string data into it. LPSTR szBuffer = sValue.GetBuffer(iResult++); - if (!szBuffer) return 0; + if (!szBuffer) { + SetLastError(ERROR_OUTOFMEMORY); + return 0; + } iResult = ::GetWindowTextA(hWnd, szBuffer, iResult); sValue.ReleaseBuffer(iResult); return iResult; @@ -122,7 +125,10 @@ inline int GetWindowTextW(__in HWND hWnd, __out ATL::CAtlStringW &sValue) if (iResult > 0) { // Prepare the buffer and read the string data into it. LPWSTR szBuffer = sValue.GetBuffer(iResult++); - if (!szBuffer) return 0; + if (!szBuffer) { + SetLastError(ERROR_OUTOFMEMORY); + return 0; + } iResult = ::GetWindowTextW(hWnd, szBuffer, iResult); sValue.ReleaseBuffer(iResult); return iResult; From 8fcf3153298281a4033f9c64c9be93b775518005 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 6 Apr 2015 08:45:15 +0000 Subject: [PATCH 047/135] --- atlwin.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/atlwin.h b/atlwin.h index 651303b..c213767 100644 --- a/atlwin.h +++ b/atlwin.h @@ -232,6 +232,27 @@ inline DWORD ExpandEnvironmentStringsW(__in LPCWSTR lpSrc, ATL::CAtlStringW &sVa } +inline VOID GuidToString(_In_ LPCGUID lpGuid, ATL::CAtlStringA &str) +{ + str.Format("{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + lpGuid->Data1, + lpGuid->Data2, + lpGuid->Data3, + lpGuid->Data4[0], lpGuid->Data4[1], + lpGuid->Data4[2], lpGuid->Data4[3], lpGuid->Data4[4], lpGuid->Data4[5], lpGuid->Data4[6], lpGuid->Data4[7]); +} + + +inline VOID GuidToString(_In_ LPCGUID lpGuid, ATL::CAtlStringW &str) +{ + str.Format(L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + lpGuid->Data1, + lpGuid->Data2, + lpGuid->Data3, + lpGuid->Data4[0], lpGuid->Data4[1], + lpGuid->Data4[2], lpGuid->Data4[3], lpGuid->Data4[4], lpGuid->Data4[5], lpGuid->Data4[6], lpGuid->Data4[7]); +} + inline LSTATUS RegQueryStringValue(_In_ HKEY hReg, _In_z_ LPCSTR pszName, _Out_ ATL::CAtlStringA &sValue) { From 45a741d7db75ef134565e83fcadd464ff4bf2d44 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 9 Apr 2015 08:50:24 +0000 Subject: [PATCH 048/135] =?UTF-8?q?Gradual=20code=20migration=20to=20ATL?= =?UTF-8?q?=20and=20object-oriented=20approach:=20-=20Configuration,=20use?= =?UTF-8?q?r=20and=20session=20data=20are=20now=20internally=20stored=20as?= =?UTF-8?q?=20objects.=20-=20Object=20wrappers=20for=20many=20structs=20an?= =?UTF-8?q?d=20primitives=20added.=20-=20Code=20partially=20rewritten=20to?= =?UTF-8?q?=20work=20with=20objects=20and=20benefit=20out-of-scope=20clean?= =?UTF-8?q?-up=20using=20object=20destructors.=20-=20=E2=80=A6And=20a=20lo?= =?UTF-8?q?t=20more=20code=20internal=20changes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configuration, user and other data is now passed as compact BLOBs in inter-process communication greatly reducing communication payload. --- atl.vcxproj | 1 + atl.vcxproj.filters | 3 + atlcrypt.h | 42 ++++++++++- atleap.h | 46 ++++++++++++ atlex.h | 179 +++++++++++++++++++++++++++++++++++++++++--- atlwin.h | 73 ++++++++++++++++++ 6 files changed, 331 insertions(+), 13 deletions(-) create mode 100644 atleap.h diff --git a/atl.vcxproj b/atl.vcxproj index be2a208..a8d6020 100644 --- a/atl.vcxproj +++ b/atl.vcxproj @@ -104,6 +104,7 @@ + diff --git a/atl.vcxproj.filters b/atl.vcxproj.filters index 37be935..98c6f2d 100644 --- a/atl.vcxproj.filters +++ b/atl.vcxproj.filters @@ -37,5 +37,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/atlcrypt.h b/atlcrypt.h index 19c3d60..5d08c36 100644 --- a/atlcrypt.h +++ b/atlcrypt.h @@ -102,7 +102,7 @@ namespace ATL // // CCertContext // - class CCertContext : public ATL::CObjectWithHandleT + class CCertContext : public ATL::CObjectWithHandleDuplT { public: virtual ~CCertContext() throw() @@ -126,6 +126,46 @@ namespace ATL { CertFreeCertificateContext(m_h); } + + virtual HANDLE InternalDuplicate(HANDLE h) const + { + return CertDuplicateCertificateContext(h); + } + }; + + + // + // CCertChainContext + // + class CCertChainContext : public ATL::CObjectWithHandleDuplT + { + public: + virtual ~CCertChainContext() throw() + { + if (m_h) + CertFreeCertificateChain(m_h); + } + + inline BOOL Create(__in_opt HCERTCHAINENGINE hChainEngine, __in PCCERT_CONTEXT pCertContext, __in_opt LPFILETIME pTime, __in_opt HCERTSTORE hAdditionalStore, __in PCERT_CHAIN_PARA pChainPara, __in DWORD dwFlags, __reserved LPVOID pvReserved) throw() + { + HANDLE h; + if (CertGetCertificateChain(hChainEngine, pCertContext, pTime, hAdditionalStore, pChainPara, dwFlags, pvReserved, &h)) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + protected: + virtual void InternalFree() + { + CertFreeCertificateChain(m_h); + } + + virtual HANDLE InternalDuplicate(HANDLE h) const + { + return CertDuplicateCertificateChain(h); + } }; diff --git a/atleap.h b/atleap.h new file mode 100644 index 0000000..5951c70 --- /dev/null +++ b/atleap.h @@ -0,0 +1,46 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#pragma once + +#include + + +namespace ATL +{ + namespace EAP + { + class CEAPAttribute : public EAP_ATTRIBUTE + { + public: + CEAPAttribute() + { + eaType = eatReserved; + dwLength = 0; + pValue = NULL; + } + + ~CEAPAttribute() + { + if (pValue) + delete pValue; + } + }; + } +} diff --git a/atlex.h b/atlex.h index dc29262..e9a5a60 100644 --- a/atlex.h +++ b/atlex.h @@ -20,6 +20,7 @@ #pragma once #include +#include namespace ATL @@ -37,28 +38,28 @@ namespace ATL { } - inline CObjectWithHandleT(T h) throw() : m_h(h) + inline CObjectWithHandleT(HANDLE h) throw() : m_h(h) { } - inline operator T() const throw() + inline operator HANDLE() const throw() { return m_h; } - inline T*& operator*() const + inline HANDLE*& operator*() const { ATLENSURE(m_h != NULL); return *m_h; } - inline T* operator&() throw() + inline HANDLE* operator&() throw() { ATLASSERT(m_h == NULL); return &m_h; } - inline T operator->() const throw() + inline HANDLE operator->() const throw() { ATLASSERT(m_h != NULL); return m_h; @@ -69,31 +70,31 @@ namespace ATL return m_h == NULL; } - inline bool operator<(_In_opt_ T h) const throw() + inline bool operator<(_In_opt_ HANDLE h) const throw() { return m_h < h; } - inline bool operator!=(_In_opt_ T h) const + inline bool operator!=(_In_opt_ HANDLE h) const { return !operator==(h); } - inline bool operator==(_In_opt_ T h) const throw() + inline bool operator==(_In_opt_ HANDLE h) const throw() { return m_h == h; } - inline void Attach(_In_opt_ T h) throw() + inline void Attach(_In_opt_ HANDLE h) throw() { if (m_h) InternalFree(); m_h = h; } - inline T Detach() throw() + inline HANDLE Detach() throw() { - T h = m_h; + HANDLE h = m_h; m_h = NULL; return h; } @@ -110,6 +111,160 @@ namespace ATL virtual void InternalFree() = 0; protected: - T m_h; + HANDLE m_h; }; + + + // + // CObjectWithHandleDuplT + // + template + class CObjectWithHandleDuplT : public CObjectWithHandleT + { + public: + inline HANDLE GetDuplicate() const + { + return m_h ? InternalDuplicate(m_h) : NULL; + } + + inline BOOL DuplicateAndAttach(_In_opt_ HANDLE h) throw() + { + if (m_h) + InternalFree(); + + return h ? (m_h = InternalDuplicate(h)) != NULL : (m_h = NULL, TRUE); + } + + // + // Do not allow = operators. They are semantically ambigious: + // Do they attach the class to the existing instance of object, or do they duplicate it? + // To avoid confusion, user should use Attach() and Duplicate() methods explicitly. + // + //inline const CObjectWithHandleDuplT& operator=(_In_ const HANDLE src) + //{ + // Attach(src ? InternalDuplicate(src) : NULL); + // return *this; + //} + + //inline const CObjectWithHandleDuplT& operator=(_In_ const CObjectWithHandleDuplT &src) + //{ + // Attach(src.m_h ? InternalDuplicate(src.m_h) : NULL); + // return *this; + //} + + protected: + virtual HANDLE InternalDuplicate(HANDLE h) const = 0; + }; + + + // + // CStrFormatT, CStrFormatW, CStrFormatA, CStrFormat + // + template + class CStrFormatT : public CStringT + { + public: + CStrFormatT(_In_z_ _FormatMessage_format_string_ PCXSTR pszFormat, ...) + { + ATLASSERT(AtlIsValidString(pszFormat)); + + va_list argList; + va_start(argList, pszFormat); + FormatV(pszFormat, argList); + va_end(argList); + } + + CStrFormatT(_In_ _FormatMessage_format_string_ UINT nFormatID, ...) + { + CStringT strFormat(GetManager()); + ATLENSURE(strFormat.LoadString(nFormatID)); + + va_list argList; + va_start(argList, nFormatID); + FormatV(strFormat, argList); + va_end(argList); + } + + CStrFormatT(_In_ HINSTANCE hInstance, _In_ _FormatMessage_format_string_ UINT nFormatID, ...) + { + CStringT strFormat(GetManager()); + ATLENSURE(strFormat.LoadString(hInstance, nFormatID)); + + va_list argList; + va_start(argList, nFormatID); + FormatV(strFormat, argList); + va_end(argList); + } + + CStrFormatT(_In_ HINSTANCE hInstance, _In_ WORD wLanguageID, _In_ _FormatMessage_format_string_ UINT nFormatID, ...) + { + CStringT strFormat(GetManager()); + ATLENSURE(strFormat.LoadString(hInstance, nFormatID, wLanguageID)); + + va_list argList; + va_start(argList, nFormatID); + FormatV(strFormat, argList); + va_end(argList); + } + }; + + typedef CStrFormatT< wchar_t, StrTraitATL< wchar_t, ChTraitsCRT< wchar_t > > > CStrFormatW; + typedef CStrFormatT< char, StrTraitATL< char, ChTraitsCRT< char > > > CStrFormatA; + typedef CStrFormatT< TCHAR, StrTraitATL< TCHAR, ChTraitsCRT< TCHAR > > > CStrFormat; + + + // + // CStrFormatMsgT, CStrFormatMsgW, CStrFormatMsgA, CStrFormatMsg + // + template + class CStrFormatMsgT : public CStringT + { + public: + CStrFormatMsgT(_In_z_ _FormatMessage_format_string_ PCXSTR pszFormat, ...) + { + ATLASSERT(AtlIsValidString(pszFormat)); + + va_list argList; + va_start(argList, pszFormat); + FormatMessageV(pszFormat, &argList); + va_end(argList); + } + + CStrFormatMsgT(_In_ _FormatMessage_format_string_ UINT nFormatID, ...) + { + CStringT strFormat(GetManager()); + ATLENSURE(strFormat.LoadString(nFormatID)); + + va_list argList; + va_start(argList, nFormatID); + FormatMessageV(strFormat, &argList); + va_end(argList); + } + + CStrFormatMsgT(_In_ HINSTANCE hInstance, _In_ _FormatMessage_format_string_ UINT nFormatID, ...) + { + CStringT strFormat(GetManager()); + ATLENSURE(strFormat.LoadString(hInstance, nFormatID)); + + va_list argList; + va_start(argList, nFormatID); + FormatMessageV(strFormat, &argList); + va_end(argList); + } + + CStrFormatMsgT(_In_ HINSTANCE hInstance, _In_ WORD wLanguageID, _In_ _FormatMessage_format_string_ UINT nFormatID, ...) + { + CStringT strFormat(GetManager()); + ATLENSURE(strFormat.LoadString(hInstance, nFormatID, wLanguageID)); + + va_list argList; + va_start(argList, nFormatID); + FormatMessageV(strFormat, &argList); + va_end(argList); + } + }; + + typedef CStrFormatMsgT< wchar_t, StrTraitATL< wchar_t, ChTraitsCRT< wchar_t > > > CStrFormatMsgW; + typedef CStrFormatMsgT< char, StrTraitATL< char, ChTraitsCRT< char > > > CStrFormatMsgA; + typedef CStrFormatMsgT< TCHAR, StrTraitATL< TCHAR, ChTraitsCRT< TCHAR > > > CStrFormatMsg; } diff --git a/atlwin.h b/atlwin.h index c213767..f4056de 100644 --- a/atlwin.h +++ b/atlwin.h @@ -19,6 +19,7 @@ #pragma once +#include "atlex.h" #include #include #include @@ -348,3 +349,75 @@ inline LSTATUS RegQueryValueExW(__in HKEY hKey, __in_opt LPCWSTR lpValueName, __ return lResult; } + + +#if _WIN32_WINNT >= _WIN32_WINNT_VISTA + +inline LSTATUS RegLoadMUIStringA(__in HKEY hKey, __in_opt LPCSTR pszValue, __out ATL::CAtlStringA &sOut, __in DWORD Flags, __in_opt LPCSTR pszDirectory) +{ + LSTATUS lResult; + DWORD dwSize; + + Flags &= ~REG_MUI_STRING_TRUNCATE; + + lResult = RegLoadMUIStringA(hKey, pszValue, NULL, 0, &dwSize, Flags, pszDirectory); + if (lResult == ERROR_MORE_DATA) { + LPSTR szBuffer = sOut.GetBuffer(dwSize - 1); + if (!szBuffer) return ERROR_OUTOFMEMORY; + sOut.ReleaseBuffer((lResult = RegLoadMUIStringA(hKey, pszValue, szBuffer, dwSize, &dwSize, Flags, pszDirectory)) == ERROR_SUCCESS ? dwSize - 1 : 0); + } else if (lResult == ERROR_SUCCESS) + sOut.Empty(); + + return lResult; +} + + +inline LSTATUS RegLoadMUIStringW(__in HKEY hKey, __in_opt LPCWSTR pszValue, __out ATL::CAtlStringW &sOut, __in DWORD Flags, __in_opt LPCWSTR pszDirectory) +{ + LSTATUS lResult; + DWORD dwSize; + + Flags &= ~REG_MUI_STRING_TRUNCATE; + + lResult = RegLoadMUIStringW(hKey, pszValue, NULL, 0, &dwSize, Flags, pszDirectory); + if (lResult == ERROR_MORE_DATA) { + LPWSTR szBuffer = sOut.GetBuffer(dwSize - 1); + if (!szBuffer) return ERROR_OUTOFMEMORY; + sOut.ReleaseBuffer((lResult = RegLoadMUIStringW(hKey, pszValue, szBuffer, dwSize, &dwSize, Flags, pszDirectory)) == ERROR_SUCCESS ? dwSize - 1 : 0); + } else if (lResult == ERROR_SUCCESS) + sOut.Empty(); + + return lResult; +} + +#endif + + +namespace ATL +{ + class CAtlLibrary : public CObjectWithHandleT + { + public: + virtual ~CAtlLibrary() throw() + { + if (m_h) + FreeLibrary(m_h); + } + + inline BOOL Load(__in LPCTSTR lpFileName, __reserved HANDLE hFile, __in DWORD dwFlags) throw() + { + HANDLE h = LoadLibraryEx(lpFileName, hFile, dwFlags); + if (h) { + Attach(h); + return TRUE; + } else + return FALSE; + } + + protected: + virtual void InternalFree() + { + FreeLibrary(m_h); + } + }; +} From 5df75cdc4a97a88ae15cc5dc3cbea4cd235c63b8 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 9 Apr 2015 08:50:39 +0000 Subject: [PATCH 049/135] From d859e12e948cc7a6f4712367f6f272ca5dbf4c7f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 9 Apr 2015 08:57:04 +0000 Subject: [PATCH 050/135] Removed AL::EAP::CPacket::operator[] due to ambiguities on Win32 platforms. From 96528ae4b19c484d5d883147989dbbeaf0139923 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 9 Apr 2015 10:37:24 +0000 Subject: [PATCH 051/135] Aesthetic modifications From efb9755490544c9d24d380181ca2d40b30910045 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 9 Apr 2015 11:09:30 +0000 Subject: [PATCH 052/135] From 3ce6ade7af2c7cf078ca4d4d6eb6c30c56904d5f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 9 Apr 2015 12:53:35 +0000 Subject: [PATCH 053/135] Memory containing password is sanitized before dismissed now. --- atlex.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/atlex.h b/atlex.h index e9a5a60..adf0e93 100644 --- a/atlex.h +++ b/atlex.h @@ -19,6 +19,7 @@ #pragma once +#include #include #include @@ -267,4 +268,57 @@ namespace ATL typedef CStrFormatMsgT< wchar_t, StrTraitATL< wchar_t, ChTraitsCRT< wchar_t > > > CStrFormatMsgW; typedef CStrFormatMsgT< char, StrTraitATL< char, ChTraitsCRT< char > > > CStrFormatMsgA; typedef CStrFormatMsgT< TCHAR, StrTraitATL< TCHAR, ChTraitsCRT< TCHAR > > > CStrFormatMsg; + + + // + // CParanoidHeap + // + template + class CParanoidHeap : public BaseHeap { + public: + virtual void Free(_In_opt_ void* p) throw() + { + // Sanitize then free. + SecureZeroMemory(p, GetSize(p)); + BaseHeap::Free(p); + } + + _Ret_opt_bytecap_(nBytes) virtual void* Reallocate(_In_opt_ void* p, _In_ size_t nBytes) throw() + { + // Create a new sized copy. + void *pNew = Allocate(nBytes); + size_t nSizePrev = GetSize(p); + memcpy(pNew, p, nSizePrev); + + // Sanitize the old data then free. + SecureZeroMemory(p, nSizePrev); + Free(p); + + return pNew; + } + }; + + + // + // CW2AParanoidEX + // + template + class CW2AParanoidEX : public CW2AEX { + public: + CW2AParanoidEX(_In_z_ LPCWSTR psz) throw(...) : CW2AEX(psz) {} + CW2AParanoidEX(_In_z_ LPCWSTR psz, _In_ UINT nCodePage) throw(...) : CW2AEX(psz, nCodePage) {} + ~CW2AParanoidEX() throw() + { + // Sanitize before free. + if (m_psz != m_szBuffer) + SecureZeroMemory(m_psz, _msize(m_psz)); + else + SecureZeroMemory(m_szBuffer, sizeof(m_szBuffer)); + } + }; + + // + // CW2AParanoid + // + typedef CW2AParanoidEX<> CW2AParanoid; } From dbbf1a55c6d100aa1abcc52cfb923236216dbc1b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 10 Apr 2015 06:02:18 +0000 Subject: [PATCH 054/135] From 79ecab585a2d467d701dd68e32c8a3bc15fae929 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 13 Apr 2015 11:48:34 +0000 Subject: [PATCH 055/135] Windows 8 not prompting for credentials or additional certificate trust issue resolved. BLOB contents is now stored in shared-memory, allowing BLOBS to keep sub 3kB on Windows 8. Aesthetic modifications From 25b43a7e8654bbbf7f74026d49e75ac738d375fb Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 14 Apr 2015 07:32:23 +0000 Subject: [PATCH 056/135] Tested and fixed RASEAP-related issues. From d099ec593720a488a9cd87ff75dad8b0df5cccbd Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 14 Apr 2015 09:17:14 +0000 Subject: [PATCH 057/135] From 1e409ddef3ea00475ea86a595ebea64e5764b9ea Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 14 Apr 2015 13:28:38 +0000 Subject: [PATCH 058/135] Read support for localized UI strings in EAP Metadata XML added. When saving, only the selected localized string is saved. From ac2e3b1d540142cb0c600e73f5fee4517c9cc649 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 15 Apr 2015 06:02:11 +0000 Subject: [PATCH 059/135] Installing MSI restarts Wlansvc, dot3svc, and EapHost services to allow reboot-less ArnesLink upgrade. From ade387d28a797afbc63a010b7444d2d8df3b7ac4 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 15 Apr 2015 06:19:03 +0000 Subject: [PATCH 060/135] From 9ae318961079f8f08c4b6a4f1b547b7b382d4caa Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 15 Apr 2015 08:15:59 +0000 Subject: [PATCH 061/135] From fc535c7b3254617a45cfbca0da3ab44bdfb8c0a7 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 16 Apr 2015 14:30:22 +0000 Subject: [PATCH 062/135] Named shared memory replaced with temporary files, as shared memory prooved useless. Tested and updated to work on Windows 8.1. From 36ca29890bf9844fc6412b464464dfae5870318b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 16 Apr 2015 14:35:07 +0000 Subject: [PATCH 063/135] From 84896db04a2a11de24fa310f260e7bc3a69f9093 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 17 Apr 2015 10:53:05 +0000 Subject: [PATCH 064/135] Version set to 1.0-pre18. From 147e16139dd74da0b6dd4d69ab0aae09ff79fd66 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 17 Apr 2015 11:05:47 +0000 Subject: [PATCH 065/135] From 9d9064e0548955cae936407b90ec452790b15eed Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 17 Apr 2015 11:05:47 +0000 Subject: [PATCH 066/135] TortoiseSVN auto commit: changed externals to fixed revision. From 774af6a328d6f67d7c2a3bcc799fdedd50059465 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 17 Apr 2015 11:05:48 +0000 Subject: [PATCH 067/135] TortoiseSVN auto commit: changed externals to fixed revision. From 7b3ae9fc4d36c36d63ca40765391bef68ac74f6c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 17 Apr 2015 11:05:48 +0000 Subject: [PATCH 068/135] TortoiseSVN auto commit: changed externals to fixed revision. From a969f181549b87a4f8d173b19c1be2f17ec2333e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 17 Apr 2015 11:43:17 +0000 Subject: [PATCH 069/135] From db41def6e59d81001e4fb07c23163a5af6c8d53f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 20 Apr 2015 12:34:22 +0000 Subject: [PATCH 070/135] AL::EAP::QueryCredentialInputFields fixed to correctly set value min and max sizes in bytes. From 6e3388997c505666c9b302630edd5dc89ab17828 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 21 Apr 2015 11:10:31 +0000 Subject: [PATCH 071/135] GetUserNameEx() wrapper added. --- atl.vcxproj | 1 + atl.vcxproj.filters | 3 ++ atlsec.h | 84 +++++++++++++++++++++++++++++++++++++++++++++ atlshlwapi.h | 4 +-- stdafx.h | 8 +++++ 5 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 atlsec.h diff --git a/atl.vcxproj b/atl.vcxproj index a8d6020..a6bf798 100644 --- a/atl.vcxproj +++ b/atl.vcxproj @@ -107,6 +107,7 @@ + diff --git a/atl.vcxproj.filters b/atl.vcxproj.filters index 98c6f2d..f305a55 100644 --- a/atl.vcxproj.filters +++ b/atl.vcxproj.filters @@ -40,5 +40,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/atlsec.h b/atlsec.h new file mode 100644 index 0000000..78a1e9d --- /dev/null +++ b/atlsec.h @@ -0,0 +1,84 @@ +/* + Copyright 1991-2015 Amebis + + This file is part of libatl. + + Setup 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 3 of the License, or + (at your option) any later version. + + Setup 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 Setup. If not, see . +*/ + +#include + + +BOOLEAN GetUserNameExA(__in EXTENDED_NAME_FORMAT NameFormat, __out ATL::CAtlStringA &sName) +{ + ULONG ulSize = 0; + + // Query the final string length first. + if (!::GetUserNameExA(NameFormat, NULL, &ulSize)) { + if (::GetLastError() == ERROR_MORE_DATA) { + // Prepare the buffer and retry. + LPSTR szBuffer = sName.GetBuffer(ulSize - 1); + if (!szBuffer) { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + if (::GetUserNameExA(NameFormat, szBuffer, &ulSize)) { + sName.ReleaseBuffer(ulSize); + return TRUE; + } else { + sName.ReleaseBuffer(0); + return FALSE; + } + } else { + // Return error. + return FALSE; + } + } else { + // The result is empty. + sName.Empty(); + return NO_ERROR; + } +} + + +BOOLEAN GetUserNameExW(__in EXTENDED_NAME_FORMAT NameFormat, __out ATL::CAtlStringW &sName) +{ + ULONG ulSize = 0; + + // Query the final string length first. + if (!::GetUserNameExW(NameFormat, NULL, &ulSize)) { + if (::GetLastError() == ERROR_MORE_DATA) { + // Prepare the buffer and retry. + LPWSTR szBuffer = sName.GetBuffer(ulSize - 1); + if (!szBuffer) { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + if (::GetUserNameExW(NameFormat, szBuffer, &ulSize)) { + sName.ReleaseBuffer(ulSize); + return TRUE; + } else { + sName.ReleaseBuffer(0); + return FALSE; + } + } else { + // Return error. + return FALSE; + } + } else { + // The result is empty. + sName.Empty(); + return NO_ERROR; + } +} diff --git a/atlshlwapi.h b/atlshlwapi.h index 76f9035..4b4dcfa 100644 --- a/atlshlwapi.h +++ b/atlshlwapi.h @@ -32,7 +32,7 @@ inline BOOL PathCanonicalizeA(__out ATL::CAtlStringA &sValue, __in LPCSTR pszPat return FALSE; } BOOL bResult = ::PathCanonicalizeA(szBuffer, pszPath); - sValue.ReleaseBuffer(bResult ? strnlen(szBuffer, MAX_PATH) : 0); + sValue.ReleaseBuffer(bResult ? (int)strnlen(szBuffer, MAX_PATH) : 0); sValue.FreeExtra(); return bResult; } @@ -47,7 +47,7 @@ inline BOOL PathCanonicalizeW(__out ATL::CAtlStringW &sValue, __in LPCWSTR pszPa return FALSE; } BOOL bResult = ::PathCanonicalizeW(szBuffer, pszPath); - sValue.ReleaseBuffer(bResult ? wcsnlen(szBuffer, MAX_PATH) : 0); + sValue.ReleaseBuffer(bResult ? (int)wcsnlen(szBuffer, MAX_PATH) : 0); sValue.FreeExtra(); return bResult; } diff --git a/stdafx.h b/stdafx.h index f2ab7f7..99c70cc 100644 --- a/stdafx.h +++ b/stdafx.h @@ -22,4 +22,12 @@ #include "atlwin.h" #include "atlcrypt.h" +#include "atleap.h" +#include "atlex.h" #include "atlmsi.h" +#if defined(SECURITY_WIN32) || defined(SECURITY_KERNEL) || defined(SECURITY_MAC) +#include "atlsec.h" +#endif +#include "atlshlwapi.h" +#include "atlwin.h" +#include "atlwlan.h" From b4ad3dd9784e74511116bd05cc51f307b0364f58 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 21 Apr 2015 11:13:58 +0000 Subject: [PATCH 072/135] Windows 10 checks added to return an error rather than request the UI prompt doomed to fail. Aesthetic modifications From 926db96bd8f9324fb950e403ab5ae2c4f352ef69 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 22 Apr 2015 11:22:47 +0000 Subject: [PATCH 073/135] Version set to 1.0-pre19. From f739e758aa5d80367dc13d789f1cb8fd8cda2a68 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 22 Apr 2015 11:23:04 +0000 Subject: [PATCH 074/135] From 1de7dd8c23eae80dcc299b27216d0ebe07ae3a0f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 22 Apr 2015 11:23:04 +0000 Subject: [PATCH 075/135] TortoiseSVN auto commit: changed externals to fixed revision. From 629f3db907a6a639f238630ca83a2cf0b6169d33 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 22 Apr 2015 11:23:04 +0000 Subject: [PATCH 076/135] TortoiseSVN auto commit: changed externals to fixed revision. From 41ee9f65ed85e3b29369a1c279433f7a26784ce5 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 22 Apr 2015 11:23:04 +0000 Subject: [PATCH 077/135] TortoiseSVN auto commit: changed externals to fixed revision. From a2c6c764850eed32958c76d5872c2ea512449669 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 23 Apr 2015 10:14:45 +0000 Subject: [PATCH 078/135] EapPeerGetMethodProperties implementation added. Disabled UI prompts on Windows 10 temporary re-enabled, as Windows 10 development continues. From d2efa651a4eef98f3f506e5e70245eb547cbb2de Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 23 Apr 2015 12:22:46 +0000 Subject: [PATCH 079/135] NMAKE Registration and MSI files are now configurable to use built-in credential prompts too. From cb45984370fe064cdfdfb08838d053a17620747c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 25 Apr 2015 15:10:38 +0000 Subject: [PATCH 080/135] TTLS-MSCHAPv2 and PEAP support for pre-configured credentials added. al_import.exe upgraded to support MSCHAPv2 credentials handling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-working Renew IP setting removed. Trusting CAs on-the-fly is no longer possible. It was too “user friendly” for an inexperienced user to trust an otherwise compromised authenticator. From 26ee354b551a671a67c6f729ed4023e8d0684497 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 25 Apr 2015 15:12:05 +0000 Subject: [PATCH 081/135] From 413a2989f0480aac08b2c06c448764b6836ffd81 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:02:03 +0000 Subject: [PATCH 082/135] From 0fdea9ebce329019ec259788db32b0b8208b3fc6 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:05:47 +0000 Subject: [PATCH 083/135] Version set to 1.0-pre20. From bfd5244b8cc4d16da93016a985442414dbdb2254 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:06:10 +0000 Subject: [PATCH 084/135] From c16df7395ef097f534b2ef981bf675ed5d938506 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:06:10 +0000 Subject: [PATCH 085/135] TortoiseSVN auto commit: changed externals to fixed revision. From d1de220d8007849035eadc07cfae2e6102b8ab0b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:06:10 +0000 Subject: [PATCH 086/135] TortoiseSVN auto commit: changed externals to fixed revision. From f7597b5a6e70702dcd9bf55a0efbf5a7316d5c9d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:06:11 +0000 Subject: [PATCH 087/135] TortoiseSVN auto commit: changed externals to fixed revision. From 7b9addd02eee33586806e8794e4ee6c576ce5488 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:55:19 +0000 Subject: [PATCH 088/135] MSCHAPv2 credential BLOB is stored in element inside EAP Host XML now instead of proprietary element introduced in 1.0-pre20. From f2b3cbf0ccd2f5b29a5f46f59d99e75fa9bbf5bf Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:55:41 +0000 Subject: [PATCH 089/135] Version set to 1.0-pre21. From c4270af88d58f69db8d0631a6f7a4de574d9827e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:55:53 +0000 Subject: [PATCH 090/135] From 781d17857dbfa98f4ffd036b1c10560e6075f828 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:55:54 +0000 Subject: [PATCH 091/135] TortoiseSVN auto commit: changed externals to fixed revision. From a02c6920693b9c740cb2b30e9551b5d93a57de0c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:55:54 +0000 Subject: [PATCH 092/135] TortoiseSVN auto commit: changed externals to fixed revision. From 0b5659b67f46e0052c9c62d533594a2f793334f1 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 26 Apr 2015 13:55:54 +0000 Subject: [PATCH 093/135] TortoiseSVN auto commit: changed externals to fixed revision. From 7cefac2f74252d377e62538f17f13fe98515386e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 05:26:43 +0000 Subject: [PATCH 094/135] Version set to 1.0. From b77ca189b0c9de1f1e4287bef1975192b5d94b49 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 05:43:41 +0000 Subject: [PATCH 095/135] From b4490512d032f8914f5f8355362ac3873c58ec0b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 05:43:53 +0000 Subject: [PATCH 096/135] From ebf9bfda9e58335a25eb6d957e82506e405e22c4 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 05:43:53 +0000 Subject: [PATCH 097/135] TortoiseSVN auto commit: changed externals to fixed revision. From 0f51f4e6b81140cf6beb157bc2f8c3bbc049358a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 05:43:53 +0000 Subject: [PATCH 098/135] TortoiseSVN auto commit: changed externals to fixed revision. From a6d0e6b938d17f014f4ea8d95e3c8e7bf88f4a20 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 05:43:53 +0000 Subject: [PATCH 099/135] TortoiseSVN auto commit: changed externals to fixed revision. From 71734b02ea41b60ab491388d372f76ff070138da Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 07:19:22 +0000 Subject: [PATCH 100/135] From e3967cefe2932f88d8393a667a05caca51c227e1 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 08:35:27 +0000 Subject: [PATCH 101/135] al_res.dll renamed to al_resource.dll to allow common CAB file for multiple MSI files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSI files are prepared in two flavours now: - Fully self-contained (output\Setup folder) – with the CAB file embedded. - Installer-database only (output folder) – rely on external CAB file: suitable for re-packaging or GPO deployment. Wheel scrolling not working in profile configuration dialog until any of control gained focus issue fixed. Makefile clean-up. From b7d1f8928c077d452b8f51415c953ccb49a90f13 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 08:35:31 +0000 Subject: [PATCH 102/135] Version set to 1.0-pre1. From fff022f7c0373ca9c17f590d27f25d040b5c9c36 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 08:35:46 +0000 Subject: [PATCH 103/135] From 47ea08e09860e31975f87c7e2b22f60323e819ae Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 08:35:46 +0000 Subject: [PATCH 104/135] TortoiseSVN auto commit: changed externals to fixed revision. From ae978eb67b080a683756dbe6b5ac187aeac388ee Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 08:35:46 +0000 Subject: [PATCH 105/135] TortoiseSVN auto commit: changed externals to fixed revision. From dfd608d2b6a0ffde7aa4319744ba10d895e75d40 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 May 2015 08:35:46 +0000 Subject: [PATCH 106/135] TortoiseSVN auto commit: changed externals to fixed revision. From 7b7016b95fd4d929ec32b13146c9a018db570e03 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 05:22:31 +0000 Subject: [PATCH 107/135] The resource DLL is now loaded as data file (no code segment). This allows 32 and 64-bit DLL compatibility. From 37a7e5b6e1ffef2f18be3b5823dc65a0fac87a5a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 07:26:02 +0000 Subject: [PATCH 108/135] Setup.exe aka. ArnesLinkSetup.exe utility removed. From a3575c5e31d0384d0da831129e4e193689b5d85d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:33:22 +0000 Subject: [PATCH 109/135] 32-bit resource DLLs are used for 64-bit distributions too now to reduce CAB and MSI file size. Resource DLLs do not contain any code, therefore 32 and 64-bit versions are mutually compatible, when loaded appropriately. Separate configurations in Visual Studio project remain for simplicity. output\Setup renamed to output\standalones. From 6acb33fbf59da7c04a6c7130c45daf166dbfa193 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:33:50 +0000 Subject: [PATCH 110/135] From c43bcc27ded6532c84eb1f75a6d185acbe16ff7d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:36:41 +0000 Subject: [PATCH 111/135] Version set to 1.1-pre2. From 4459a2cf32b077d26211303c0f4dfab83710fc2f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:37:59 +0000 Subject: [PATCH 112/135] From 32014295b10ed797c43df1c48c1ee248900c639d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:38:00 +0000 Subject: [PATCH 113/135] TortoiseSVN auto commit: changed externals to fixed revision. From 0ddb2c954d7f32b660eb2096063ae00c08977fee Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:38:00 +0000 Subject: [PATCH 114/135] TortoiseSVN auto commit: changed externals to fixed revision. From 6feb7d2e73860e2f12132d2b2d97e31b1fe0bcee Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:38:00 +0000 Subject: [PATCH 115/135] TortoiseSVN auto commit: changed externals to fixed revision. From 794e912c67a954261f67b41dbbb243730515e27c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 08:59:51 +0000 Subject: [PATCH 116/135] From 7352ba41b0a05ba027d1788a257bca003d633a45 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 09:00:21 +0000 Subject: [PATCH 117/135] From e8a1f96ce1857493256301bea9c446ffa8100f5f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 09:45:01 +0000 Subject: [PATCH 118/135] =?UTF-8?q?Due=20to=20increased=20complexity=20and?= =?UTF-8?q?=20no=20significant=20size=20gain,=20common=20CAB=20file=20conc?= =?UTF-8?q?ept=20was=20dropped=20and=20related=20changes=20from=201.1-pre1?= =?UTF-8?q?=20and=201.1-pre2=20were=20reverted:=20-=20al=5Fresource.dll=20?= =?UTF-8?q?renamed=20back=20to=20al=5Fres.dll.=20-=20Only=20one=20set=20of?= =?UTF-8?q?=20final=20MSI=20files=20remained=20=E2=80=93=20fully=20self-co?= =?UTF-8?q?ntained=20ones.=20MSI=20files=20with=20shared=20CAB=20file=20di?= =?UTF-8?q?scontinued.=20-=2032=20and=2064-bit=20resource=20DLL=20file=20s?= =?UTF-8?q?haring=20dropped=20to=20simplify=20Makefile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From c960ceace2767197ce1ace16ced84078bc700c18 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 09:47:49 +0000 Subject: [PATCH 119/135] From 7c3f50ef3a9ef23b9c21f8720f7289cea55ce607 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 09:50:31 +0000 Subject: [PATCH 120/135] From ec38b0d0996eddf5552277d5631f443dd6aa23ea Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 09:54:32 +0000 Subject: [PATCH 121/135] Version set to 1.1-pre3. From 0bf9bcb1fffa3d8562b08490c6a7c6eed50635a2 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 09:58:54 +0000 Subject: [PATCH 122/135] From d1dcd680bfa50e75a973dadda0a401e28ef99f56 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 10:01:02 +0000 Subject: [PATCH 123/135] From 0a5fad4eb249844ddc9cec08fec909755e5f91ab Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 10:01:02 +0000 Subject: [PATCH 124/135] TortoiseSVN auto commit: changed externals to fixed revision. From 2294a8f5ae37568680f31854f9b9a1fff13816fd Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 10:01:02 +0000 Subject: [PATCH 125/135] TortoiseSVN auto commit: changed externals to fixed revision. From 8a01ffec8eb1d4c342ff6d9cf74e321798ee951c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 5 May 2015 10:01:02 +0000 Subject: [PATCH 126/135] TortoiseSVN auto commit: changed externals to fixed revision. From 35b7218174b8ca0546d8e8e84adeb45416cfa7c5 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 16 May 2015 15:46:33 +0000 Subject: [PATCH 127/135] Issue not showing right-click-menu in al_monitor.exe fixed. Version set to 1.1. From e89091175700ca168a30be419d1548540d6a5135 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 16 May 2015 15:51:14 +0000 Subject: [PATCH 128/135] From 1f2703e39813f71466dc1663ecc7af2bc990f01c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 16 May 2015 15:51:14 +0000 Subject: [PATCH 129/135] TortoiseSVN auto commit: changed externals to fixed revision. From e1edabda80dfe272834201707fba11c3b53810b0 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 16 May 2015 15:51:14 +0000 Subject: [PATCH 130/135] TortoiseSVN auto commit: changed externals to fixed revision. From c3f2e6625e057ed893b81c69a0a32f2998e8516b Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 16 May 2015 15:51:15 +0000 Subject: [PATCH 131/135] TortoiseSVN auto commit: changed externals to fixed revision. From 6a7ec5eea3a9ed7919e4ce52a728452df6cf6627 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 11 Sep 2015 11:43:56 +0000 Subject: [PATCH 132/135] From 232b8f1bf3ab19e8097e7f8e4fbff8604815e3ab Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 1 Oct 2015 13:20:47 +0000 Subject: [PATCH 133/135] From 32791184a0ff88584861dc5fd2a1fd2c20d31e3f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 1 Oct 2015 13:20:53 +0000 Subject: [PATCH 134/135] From 8802cc7a5308defc379fdc598728d699d23a017a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 7 Oct 2015 07:55:23 +0000 Subject: [PATCH 135/135] --- atl.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atl.vcxproj b/atl.vcxproj index a6bf798..70a1826 100644 --- a/atl.vcxproj +++ b/atl.vcxproj @@ -69,7 +69,7 @@ - +