Ejemplo n.º 1
0
DWORD CPwQualityEst::EstimatePasswordBits(LPCTSTR lpPassword)
{
#ifdef _UNICODE
	return CPwQualityEst::_EstimateQuality(lpPassword);
#else
	LPWSTR lpw = _StringToUnicode(lpPassword);
	if(lpw == NULL) { ASSERT(FALSE); return 0; }

	const DWORD dwRes = CPwQualityEst::_EstimateQuality(lpw);

	mem_erase((unsigned char *)lpw, wcslen(lpw) * sizeof(WCHAR));
	SAFE_DELETE_ARRAY(lpw);
	return dwRes;
#endif
}
Ejemplo n.º 2
0
void CPwGeneratorAdvDlg::OnBtnOK()
{
	UpdateData(TRUE);

	m_pOpt->bNoConfusing = ((m_bNoConfusing == FALSE) ? FALSE : TRUE);
	m_pOpt->bNoRepeat = ((m_bNoRepeat == FALSE) ? FALSE : TRUE);

#ifdef _UNICODE
	m_pOpt->strExcludeChars = m_strExcludeChars;
#else
	WCHAR *pExcl = _StringToUnicode(m_strExcludeChars);
	m_pOpt->strExcludeChars = pExcl;
	SAFE_DELETE_ARRAY(pExcl);
#endif

	OnOK();
}
Ejemplo n.º 3
0
void NewGUI_SetCueBanner_TB(HWND hTextBox, LPCTSTR lpText)
{
	ASSERT(lpText != NULL); if(lpText == NULL) return;

	// On Windows XP there's a drawing bug at the left border (text is
	// not displayed correctly), therefore prepend a space on Windows XP
	CString strSearchTr = ((AU_IsAtLeastWinVistaSystem() == FALSE) ? _T(" ") : _T(""));
	strSearchTr += lpText;

#ifndef _UNICODE
	LPCWSTR pSearchUni = _StringToUnicode(strSearchTr);
#else // Unicode
	LPCWSTR pSearchUni = strSearchTr;
#endif

	::SendMessage(hTextBox, EM_SETCUEBANNER, 0, (LPARAM)pSearchUni);

#ifndef _UNICODE
	SAFE_DELETE_ARRAY(pSearchUni);
#endif
}
Ejemplo n.º 4
0
STDMETHODIMP_(WCHAR*) CKpUtilitiesImpl::MultiByteToUnicode(const char* lpString)
{
	return _StringToUnicode(lpString);
}