• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LPBYTE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LPBYTE函数的典型用法代码示例。如果您正苦于以下问题:C++ LPBYTE函数的具体用法?C++ LPBYTE怎么用?C++ LPBYTE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LPBYTE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AddURLToDownload

BOOL AddURLToDownload (LPCSTR pszUrl, LPCSTR pszReferer, LPCSTR pszComment, BOOL bAutoStart)
{
	DWORD dwErr;
	HKEY key;
	static int _iKey = 0;

	char szKey [1000];
	wsprintf (szKey, "URLsToDownload\\FdmSetupInstaller_%d", _iKey++);

	dwErr = RegCreateKey (_hFDMKey, szKey, &key);

	if (dwErr != ERROR_SUCCESS && dwErr)
		return FALSE;

	RegSetValueEx (key, "URL", NULL, REG_SZ, LPBYTE (pszUrl), lstrlen (pszUrl));
	RegSetValueEx (key, "Referer", NULL, REG_SZ, LPBYTE (pszReferer), lstrlen (pszReferer));
	RegSetValueEx (key, "Comment", NULL, REG_SZ, LPBYTE (pszComment), lstrlen (pszComment));
	DWORD dw = TRUE;
	RegSetValueEx (key, "Silent", NULL, REG_DWORD, (LPBYTE)&dw, sizeof (dw));
	RegSetValueEx (key, "zlr", 0, REG_DWORD, (LPBYTE)&dw, sizeof (dw));
	
	if (bAutoStart)
		dw = TRUE;
	else
		dw = FALSE;

	RegSetValueEx (key, "AutoStart", NULL, REG_DWORD, (LPBYTE)&dw, sizeof (dw));
	
	RegCloseKey (key);

	return TRUE;
}
开发者ID:DragonZX,项目名称:fdm2,代码行数:32,代码来源:FDMCustomized_PreExe.cpp


示例2: ASSERT

void CClientContext::OnRecvDataCompleted( DWORD dwIOSize )
{		
	CString strLog;
	ASSERT(m_cRecvDataBuffer != NULL);

	m_dwReceivedSize += dwIOSize;
	m_i64RecvCnt++;
	strLog.Format(_T("GTM:[1]m_dwPacketSize=%d,m_dwReceivedSize=%d,dwIOSize=%d,"),m_dwPacketSize,m_dwReceivedSize,dwIOSize);
	//OutputDebugString(strLog);
	//printf("recv[%x]_%I64d,iosize=%d---total=%d\r\n",this,m_i64RecvCnt,dwIOSize,m_dwReceivedSize);

	char * pData = m_iIO.databuf.buf;
	pData[dwIOSize] = '\0';
	//strLog.Format()
// 	if (m_dwReceivedSize < m_dwPacketSize)
// 	{				
// 		AsyncRecvBody(m_dwPacketSize - m_dwReceivedSize);
// 	}
// 	else if (m_dwReceivedSize == m_dwPacketSize)
	{			
		strLog.Format(_T("GTM:[2]m_dwPacketSize=%d,m_dwReceivedSize=%d,dwIOSize=%d"),m_dwPacketSize,m_dwReceivedSize,dwIOSize);
		//OutputDebugString(strLog);

		strLog.Format(_T("Server have received a msg(%d).Socket=%d. OnRecvBodyCompleted"),m_dwPacketSize,m_s);
		//WriteLog(SERVERLOGNAME, _T("OnRecvBodyCompleted"), strLog);

		if (m_pRecvCBFunc != NULL)
		{
			m_pRecvCBFunc(STATUS_OK,LPBYTE(this), LPBYTE(pData), dwIOSize, m_pRecvCBUserData);
		}
		else
		{
			WriteLog(SERVERLOGNAME, logLevelWarring, _T("m_pRecvCBFunc == NULL when OnRecvBodyCompleted!"));
		}

		//必须也用m_CallBackLock保护,防止在析构里同时释放内存池
// 		if(!m_pMemPool->ReleaseBuffer(m_pRecvBufferCell,1))
// 		{
// 			strLog.Format(_T("m_pMemPool->ReleaseBuffer failed. Socket=%d"), m_s);
// 			WriteLog(SERVERLOGNAME,logLevelWarring, strLog);
// 		}
// 		m_pRecvBufferCell = NULL;

		AsyncRecvData();
	}
// 	else
// 	{
// 		strLog.Format(_T("GTM:[3]m_dwPacketSize=%d,m_dwReceivedSize=%d,dwIOSize=%d"),m_dwPacketSize,m_dwReceivedSize,dwIOSize);
// 		//OutputDebugString(strLog);
// 	}
}
开发者ID:daiybh,项目名称:GPSGater,代码行数:51,代码来源:ClientContext.cpp


示例3: decodeBuffer

void* CCrypt::decodeBuffer(const BYTE *pBuf, size_t bufLen, size_t *cbResultLen)
{
	if (cbResultLen)
		*cbResultLen = 0;

	if (!m_valid || pBuf == NULL || (bufLen % BLOCK_SIZE) != 0)
		return NULL;

	char *result = (char*)mir_alloc(bufLen + 1);

	if (decrypt_cbc(m_ctx, LPBYTE(pBuf), (BYTE*)result, bufLen)) {
		mir_free(result);
		return NULL;
	}

	result[bufLen] = 0;
	WORD cbLen = *(PWORD)result;
	if (cbLen > bufLen) {
		mir_free(result);
		return NULL;
	}

	memmove(result, result + 2, cbLen);
	if (cbResultLen)
		*cbResultLen = cbLen;
	return result;
}
开发者ID:wyrover,项目名称:miranda-ng,代码行数:27,代码来源:encrypt.cpp


示例4: DWORD

bool
CExampleDlg::SaveSetting(HKEY key, LPCTSTR pcName, LPCTSTR pcValue)
{
	DWORD nBytes = DWORD(sizeof(TCHAR) * (_tcslen(pcValue) + 1));
	return RegSetValueEx(key, pcName, 0, REG_SZ, LPBYTE(pcValue),
			nBytes) == ERROR_SUCCESS;
}
开发者ID:RavenX8,项目名称:mysqlpp,代码行数:7,代码来源:mfc_dlg.cpp


示例5: RegQueryValueEx

bool
CExampleDlg::LoadSetting(HKEY key, LPCTSTR pcName, LPTSTR pcValue,
		DWORD nValueSize)
{
	return RegQueryValueEx(key, pcName, 0, 0, LPBYTE(pcValue),
			&nValueSize) == ERROR_SUCCESS;
}
开发者ID:RavenX8,项目名称:mysqlpp,代码行数:7,代码来源:mfc_dlg.cpp


示例6: LPBYTE

//--------------------------------------------------------------------------------
CNTService::~CNTService()
	{
	AFX_MANAGE_STATE_IF_DLL

	g_this = NULL;
	delete[] LPBYTE(m_pUserSID);
	}
开发者ID:moosethemooche,项目名称:Certificate-Server,代码行数:8,代码来源:NTService.cpp


示例7: while

HRESULT CLZMA::ReadPart(void *data, UINT32 size, UINT32 *processedSize)
{
  if (processedSize)
    *processedSize = 0;
  while (size)
  {
    if (!avail_in)
    {
      if (finish)
      {
        return S_OK;
      }
      GetMoreIO();
      if (!avail_in)
      {
        if (finish)
        {
          return S_OK;
        }
        return E_ABORT;
      }
      if (compressor_finished)
        return E_ABORT;
    }
    UINT32 l = std::min(size, avail_in);
    memcpy(data, next_in, l);
    avail_in -= l;
    size -= l;
    next_in += l;
    data = LPBYTE(data) + l;
    if (processedSize)
      *processedSize += l;
  }
  return S_OK;
}
开发者ID:kichik,项目名称:nsis-1,代码行数:35,代码来源:clzma.cpp


示例8: LPBYTE

bool pws_os::RegReadSTValue(const TCHAR *name, stringT &value)
{
  if (!bSubTreeKeyValid)
    return bSubTreeKeyValid;

  bool retval = false;
  LONG rv;
  DWORD dwType, DataLen;
  rv = ::RegQueryValueEx(hSubTreeKey,
                         name,
                         NULL,
                         &dwType,
                         NULL,
                         &DataLen);
  if (rv == ERROR_SUCCESS && dwType == REG_SZ) {
    DataLen++;
    TCHAR *pData = new TCHAR[DataLen];
    ::memset(pData, 0, DataLen);
    rv = ::RegQueryValueEx(hSubTreeKey,
                            name,
                            NULL,
                            &dwType,
                            LPBYTE(pData),
                            &DataLen);

    if (rv == ERROR_SUCCESS) {
      value = pData;
      retval = true;
    }
    delete[] pData;
  }
  return retval;
}
开发者ID:Sp1l,项目名称:pwsafe,代码行数:33,代码来源:registry.cpp


示例9: data

QPCSCReader::Result QPCSCReader::transfer( const QByteArray &cmd ) const
{
	static const SCARD_IO_REQUEST T0 = { 1, 8 };
	static const SCARD_IO_REQUEST T1 = { 2, 8 };
	QByteArray data( 255 + 3, 0 );
	DWORD size = data.size();

	qDebug() << "Send:" << cmd.toHex();
	DWORD ret = SCardTransmit( d->card, d->proto == SCARD_PROTOCOL_T0 ? &T0 : &T1,
		LPCBYTE(cmd.constData()), cmd.size(), 0, LPBYTE(data.data()), &size );
	if( ret != SCARD_S_SUCCESS )
	{
		qDebug() << "Err:" << ret;
		return Result();
	}

	Result result( data.mid( size-2, 2 ), data.left( size - 2 ) );
	qDebug() << "Recv:" << result.first.toHex() << result.second.toHex();

	if( result.first.at( 0 ) == 0x61 )
	{
		QByteArray cmd( "\x00\xC0\x00\x00\x00", 5 );
		cmd[4] = data.at( size-1 );
		return transfer( cmd );
	}
	return result;
}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:27,代码来源:QPCSC.cpp


示例10: sizeof

HGLOBAL POTraceCtl::CreateDropFilesW(const String& strUrl)
{
	int nBufferSize = sizeof(DROPFILES) + sizeof(wchar) * (strUrl.GetLength() + 1) + sizeof(wchar);

	// Allocate memory from the heap for the DROPFILES struct.
	HGLOBAL hgDrop = GlobalAlloc( GHND | GMEM_SHARE, nBufferSize);
	if( NULL == hgDrop )
		return 0;
	
	DROPFILES* pDrop = (DROPFILES*) GlobalLock(hgDrop);
	if( NULL == pDrop )
	{
		GlobalFree(hgDrop);
		return 0;
	}

	pDrop->pFiles = sizeof(DROPFILES);
	pDrop->fWide = TRUE;

	wchar* pszBuff = (wchar*) (LPBYTE(pDrop) + sizeof(DROPFILES));
	chustd::Memory::Copy16(pszBuff, strUrl.GetBuffer(), strUrl.GetLength() + 1);
	
	GlobalUnlock(hgDrop);

	return hgDrop;
}
开发者ID:hadrien-psydk,项目名称:pngoptimizer,代码行数:26,代码来源:POTraceCtl.cpp


示例11: IsClassNet

	// ////////////////////////////////////////////////////////////////////////////////
	// @private IsClassNet 
	//
	static BOOL IsClassNet( GUID * ClassGuid )
	{
#define MAX_NUM  50

		HKEY hKeyClass;
		LONG lRet;
		WCHAR ClassType[MAX_NUM];
		WCHAR NetClass[MAX_NUM] = L"Net";
		DWORD dwLength = MAX_NUM,dwType = REG_SZ;

		if (hKeyClass = SetupDiOpenClassRegKey(ClassGuid,KEY_READ))
		{
			lRet = RegQueryValueExW(
				hKeyClass, 
				L"Class", 
				NULL, 
				&dwType, 
				LPBYTE(ClassType), 
				&dwLength);

			RegCloseKey(hKeyClass);

			if ( lRet != ERROR_SUCCESS )
			{
				return FALSE;
			}

			if ( !wcscmp(ClassType,NetClass) )
			{
				return TRUE;
			}
		}                                 

		return FALSE;
	}
开发者ID:sssooonnnggg,项目名称:LibSrn,代码行数:38,代码来源:NetTools.cpp


示例12: LPBYTE

CHtmlStream& CHtmlStream::operator<<(const CLongBinary& blob)
{
	if (blob.m_dwDataLength > 0 && blob.m_hData != NULL)
	{
		LPBYTE pbData = LPBYTE( GlobalLock(blob.m_hData) );
	  if (pbData != NULL )
	  {
		 UINT_PTR nBytesLeft;

		 nBytesLeft = blob.m_dwDataLength;
		 while( nBytesLeft > 0 )
		 {
			UINT nBytesToWrite;

			nBytesToWrite = (UINT)min( nBytesLeft, INT_MAX );
			Write(pbData, nBytesToWrite);
			nBytesLeft -= nBytesToWrite;
			pbData += nBytesToWrite;
		 }
		 GlobalUnlock( blob.m_hData );
	  }
	}

	return *this;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:25,代码来源:isapimix.cpp


示例13: ProcessImage

void ProcessImage(HBITMAP image)
{
	return;
	DIBSECTION dibsection = {0};
	int nBytes = 0;
	
	nBytes = ::GetObject( image, sizeof( DIBSECTION ), &dibsection );
	if( nBytes == sizeof( DIBSECTION ) )
	{
		size_t width = dibsection.dsBmih.biWidth;
		size_t height = abs( dibsection.dsBmih.biHeight );
		size_t BPP = dibsection.dsBmih.biBitCount;
		if( BPP != 32 )
			return;

		void *bits = dibsection.dsBm.bmBits;
		size_t pitch = (((width * BPP) + 31) / 32) * 4;
		for(size_t i = 0; i != width; ++i)
		{
			for(size_t j = 0; j < height; ++j)
			{
				LPBYTE pucColor = LPBYTE( bits )+(j*pitch)+((i*BPP)/8);
				pucColor[0] = pucColor[0] * pucColor[3] / 255;
				pucColor[1] = pucColor[1] * pucColor[3] / 255;
				pucColor[2] = pucColor[2] * pucColor[3] / 255;
			}
		}
	}
	else
		assert(0);
}
开发者ID:corefan,项目名称:my-crawler-engine,代码行数:31,代码来源:ImageHelpers.cpp


示例14: SAFE_DELETE_ARRAY

fsInternetResult fsHttpFiles::LoadFile()
{
	UINT uToRead = 1000;		
	const FLOAT fInc = 1.2f;	

	fsInternetResult ir;    

	UINT64 uFileSize = m_httpFile.GetFileSize ();
	UINT64 uMax = uFileSize;	
	UINT64 uPos = 0;	
	DWORD dwRead;	

	if (uMax == _UI64_MAX)	
		uMax = 100000;		

	SAFE_DELETE_ARRAY (m_pszFileBuffer);

	fsnew (m_pszFileBuffer, char, int (uMax+1));

	int cZeroReads = 0;
	
	do
	{
		if (uToRead > uFileSize - uPos)
			uToRead = UINT (uFileSize - uPos);
		
		if (uPos + uToRead > uMax) 
		{

			
			uMax = UINT64 ((INT64)uMax * fInc);

			
			LPSTR psz = 0;
			fsnew (psz, char, int (uMax+1));
			CopyMemory (psz, m_pszFileBuffer, UINT (uPos));
			delete [] m_pszFileBuffer;
			m_pszFileBuffer = psz;
		}

		ir = m_httpFile.Read (LPBYTE (m_pszFileBuffer+uPos), uToRead, &dwRead);
		if (ir != IR_SUCCESS)
		{
			delete m_pszFileBuffer;
			return ir;
		}

		uPos += dwRead;	

		if (dwRead == 0)
		{
			cZeroReads ++;
			if (cZeroReads < 3 && uFileSize != _UI64_MAX)
				dwRead = 1; 
		}
		else
			cZeroReads = 0;   

	}
开发者ID:naroya,项目名称:fdm,代码行数:59,代码来源:fsHttpFiles.cpp


示例15: RegSetValueEx

void NewDeviceWidget::onSetButtonClicked()
{


	//Check whether the Device Name is of appropriate length
	if (deviceNameInput->text().count() < 1 || deviceNameInput->text().count() > 16) //1 - 16 is the valid length range
	{
		deviceNameLabel->setText("The device name must be between 1-12 characters:");
		deviceNameLabel->setPalette(errorTextPalette);
	}
	else
	{
		 
		/* Save this Device Name and Type to the Registry */

		HKEY inssidiousHKCU;
		if (ERROR_SUCCESS == RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\Inssidious\\DevicePairs", 0, 0, 0, KEY_WRITE, 0, &inssidiousHKCU, 0))
		{
			RegSetValueEx(
				inssidiousHKCU,
				QString(MAC + "-Name").toStdWString().c_str(),
				0,
				REG_SZ,
				LPBYTE(deviceNameInput->text().utf16()),
				deviceNameInput->text().size() * sizeof(wchar_t)
			);


			RegSetValueEx(
				inssidiousHKCU,
				QString(MAC + "-Type").toStdWString().c_str(),
				0,
				REG_SZ,
				LPBYTE(deviceTypeComboBox->currentText().utf16()),
				deviceTypeComboBox->currentText().size() * sizeof(wchar_t)
				);
		}


		/* Send out the name and type values */

		emit setDeviceInfo(MAC, deviceNameInput->text(), deviceTypeComboBox->currentText());

	}

}
开发者ID:ianbannerman,项目名称:Inssidious,代码行数:46,代码来源:NewDeviceWidget.cpp


示例16: ASSERT

// only CMemFile supports "direct buffering" interaction with CArchive
UINT CMemFile::GetBufferPtr(UINT nCommand, UINT nCount,
	void** ppBufStart, void**ppBufMax)
{
	ASSERT(nCommand == bufferCheck || nCommand == bufferCommit ||
		nCommand == bufferRead || nCommand == bufferWrite);

	if (nCommand == bufferCheck)
		return 1;   // just a check for direct buffer support

	if (nCommand == bufferCommit)
	{
		// commit buffer
		ASSERT(ppBufStart == NULL);
		ASSERT(ppBufMax == NULL);
		m_nPosition += nCount;
		if (m_nPosition > m_nFileSize)
			m_nFileSize = m_nPosition;
		return 0;
	}

	ASSERT(nCommand == bufferWrite || nCommand == bufferRead);
	ASSERT(ppBufStart != NULL);
	ASSERT(ppBufMax != NULL);

	// when storing, grow file as necessary to satisfy buffer request
	if (nCommand == bufferWrite && m_nPosition + nCount > m_nBufferSize)
		GrowFile(m_nPosition + nCount);

	// store buffer max and min
	*ppBufStart = m_lpBuffer + m_nPosition;

	// end of buffer depends on whether you are reading or writing
	if (nCommand == bufferWrite)
		*ppBufMax = m_lpBuffer + min(m_nBufferSize, m_nPosition + nCount);
	else
	{
		if (nCount == (UINT)-1)
			nCount = m_nBufferSize - m_nPosition;
		*ppBufMax = m_lpBuffer + min(m_nFileSize, m_nPosition + nCount);
		m_nPosition += LPBYTE(*ppBufMax) - LPBYTE(*ppBufStart);
	}

	// return number of bytes in returned buffer space (may be <= nCount)
	return LPBYTE(*ppBufMax) - LPBYTE(*ppBufStart);
}
开发者ID:anyue100,项目名称:winscp,代码行数:46,代码来源:filemem.cpp


示例17: ReportStatus

//--------------------------------------------------------------------------------
CNTService::~CNTService()
	{
	AFX_MANAGE_STATE_IF_DLL

	ReportStatus(SERVICE_STOPPED);

	g_this = NULL;
	delete[] LPBYTE(m_pUserSID);
	}
开发者ID:richschonthal,项目名称:HL7,代码行数:10,代码来源:NTService.cpp


示例18: QByteArray

QByteArray QCSPPrivate::provParam( HCRYPTPROV h, DWORD param, DWORD flags )
{
	DWORD size = 0;
	if( !CryptGetProvParam( h, param, 0, &size, flags ) )
		return QByteArray();
	QByteArray data( size, 0 );
	if( !CryptGetProvParam( h, param, LPBYTE(data.data()), &size, flags ) )
		return QByteArray();
	return data;
}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:10,代码来源:QCSP.cpp


示例19: dialog

QCSP::PinStatus QCSP::login( const TokenData &t )
{
	if( !d->h )
		return PinUnknown;

	PinDialog dialog( PinDialog::Pin2Type, t, qApp->activeWindow() );
	if( !dialog.exec() )
		return PinCanceled;
	return CryptSetProvParam( d->h, PP_SIGNATURE_PIN, LPBYTE(dialog.text().utf16()), 0 ) ? PinOK : PinUnknown;
}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:10,代码来源:QCSP.cpp


示例20: SetupDiGetClassDevs

QStringList QPCSC::drivers() const
{
#ifdef Q_OS_WIN
	HDEVINFO h = SetupDiGetClassDevs( 0, 0, 0, DIGCF_ALLCLASSES | DIGCF_PRESENT );
	if( !h )
		return QStringList();

	SP_DEVINFO_DATA info = { sizeof(SP_DEVINFO_DATA) };
	QStringList list;
	for( DWORD i = 0; SetupDiEnumDeviceInfo( h, i, &info ); i++ )
	{
		DWORD size = 0;
		WCHAR data[1024];

		SetupDiGetDeviceRegistryPropertyW( h, &info,
			SPDRP_CLASS, 0, LPBYTE(data), sizeof(data), &size );
		if( _wcsicmp( data, L"SmartCardReader" ) != 0 )
			continue;

		DWORD conf = 0;
		SetupDiGetDeviceRegistryPropertyW( h, &info,
			SPDRP_CONFIGFLAGS, 0, LPBYTE(&conf), sizeof(conf), &size );
		if( conf & CONFIGFLAG_DISABLED )
			continue;

		SetupDiGetDeviceRegistryPropertyW( h, &info,
			SPDRP_DEVICEDESC, 0, LPBYTE(data), sizeof(data), &size );
		QString name( (QChar*)data );

		SetupDiGetDeviceRegistryPropertyW( h, &info,
			SPDRP_HARDWAREID, 0, LPBYTE(data), sizeof(data), &size );

		list << QString( "%1 (%2)").arg( name, QString( (QChar*)data ) );
	}
	SetupDiDestroyDeviceInfoList( h );

	return list;
#else
	return readers();
#endif
}
开发者ID:open-eid,项目名称:qt-common,代码行数:41,代码来源:QPCSC.cpp



注:本文中的LPBYTE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LPCSTR函数代码示例发布时间:2022-05-30
下一篇:
C++ LPARAM函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap