亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? propset.cpp

?? 連接oracle
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1997 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.

#include "stdafx.h"

#if !defined(_MAC)

#include <malloc.h>
#include <ole2.h>
#include <oleauto.h>
#include "propset.h"

#ifdef AFXCTL_PROP_SEG
#pragma code_seg(AFXCTL_PROP_SEG)
#endif

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#define new DEBUG_NEW


static LPVOID CountPrefixedStringA(LPCSTR lpsz)
{
	DWORD cb = (lstrlenA( lpsz ) + 1);
	LPDWORD lp = (LPDWORD)malloc( (int)cb + sizeof(DWORD) );
	if (lp)
	{
		*lp = cb;
		lstrcpyA( (LPSTR)(lp+1), lpsz );
	}

	return (LPVOID)lp;
}


static LPVOID CountPrefixedStringW(LPCWSTR lpsz)
{
	DWORD cb = (wcslen( lpsz ) + 1);
	LPDWORD lp = (LPDWORD)malloc( (int)cb * sizeof(WCHAR) + sizeof(DWORD) );
	if (lp)
	{
		*lp = cb;
		wcscpy( (LPWSTR)(lp+1), lpsz );
	}

	return (LPVOID)lp;
}


#ifdef _UNICODE
#define CountPrefixedStringT CountPrefixedStringW
#else
#define CountPrefixedStringT CountPrefixedStringA
#endif


#ifdef _UNICODE

#define MAX_STRLEN 1024

static LPBYTE ConvertStringProp(LPBYTE pbProp, DWORD dwType, ULONG nReps,
	size_t cbCharSize)
{
	LPBYTE pbResult = NULL; // Return value
	ULONG cbResult = 0;     // Number of bytes in pbResult
	LPBYTE pbBuffer;        // Temporary holding space
	ULONG cchOrig;          // Number of characters in original string
	ULONG cchCopy;          // Number of characters to copy
	ULONG cbCopy;           // Number of bytes to copy
	LPBYTE pbResultNew;     // Used for realloc of pbResult

	pbBuffer = (LPBYTE)malloc(MAX_STRLEN * cbCharSize);
	if (pbBuffer == NULL)
		return NULL;

	// If it's a vector, the count goes first.
	if (dwType & VT_VECTOR)
	{
		pbResult = (LPBYTE)malloc(sizeof(DWORD));
		if (pbResult == NULL)
		{
			free(pbBuffer);
			return NULL;
		}
		*(LPDWORD)pbResult = nReps;
		cbResult = sizeof(DWORD);
	}

	while (nReps--)
	{
		cchOrig = *(LPDWORD)pbProp;
		pbProp += sizeof(DWORD);

		// Convert multibyte string to Unicode.
		if (cbCharSize == sizeof(WCHAR))
		{
			cchCopy = _mbstowcsz((LPWSTR)pbBuffer, (LPSTR)pbProp,
				min(cchOrig, MAX_STRLEN));
		}
		else
		{
			cchCopy = _wcstombsz((LPSTR)pbBuffer, (LPWSTR)pbProp,
				min(cchOrig, MAX_STRLEN));
		}

		// Allocate space to append string.
		cbCopy = cchCopy * cbCharSize;
		pbResultNew = (LPBYTE)realloc(pbResult, cbResult + sizeof(DWORD) +
			cbCopy);

		// If allocation failed, cleanup and return NULL;
		if (pbResultNew == NULL)
		{
			free(pbResult);
			free(pbBuffer);
			return NULL;
		}

		pbResult = pbResultNew;

		// Copy character count and converted string into place,
		// then update the total size.
		memcpy(pbResult + cbResult, (LPBYTE)&cchCopy, sizeof(DWORD));
		memcpy(pbResult + cbResult + sizeof(DWORD), pbBuffer, cbCopy);
		cbResult += sizeof(DWORD) + cbCopy;

		// Advance to the next vector element
		pbProp += (cchOrig * cbCharSize);
	}

	free(pbBuffer);
	return pbResult;
}

#endif // _UNICODE


/////////////////////////////////////////////////////////////////////////////
//Implementation of the CProperty class

CProperty::CProperty( void )
{
	m_dwPropID = 0;

	m_dwType = VT_EMPTY;
	m_pValue = NULL;       // must init to NULL
}

CProperty::CProperty( DWORD dwID, const LPVOID pValue, DWORD dwType )
{
	m_dwPropID = dwID;
	m_dwType = dwType;
	m_pValue = NULL;       // must init to NULL
	Set( dwID, pValue, dwType );
}

CProperty::~CProperty()
{
	FreeValue();
}

BOOL CProperty::Set( DWORD dwID, const LPVOID pValue, DWORD dwType )
{
	m_dwType = dwType;
	m_dwPropID = dwID;

	return Set( pValue );
}

BOOL CProperty::Set( const LPVOID pValue, DWORD dwType )
{
	m_dwType = dwType;
	return Set( pValue );
}

BOOL CProperty::Set( const  LPVOID pVal )
{
	ULONG           cb;
	ULONG           cbItem;
	ULONG           cbValue;
	ULONG           nReps;
	LPBYTE          pCur;
	LPVOID          pValue = pVal;
	DWORD           dwType = m_dwType;
	LPVOID          pValueOrig = NULL;

	if (m_pValue != NULL)
	{
		FreeValue();
	}

	if (pValue == NULL || m_dwType == 0)
		return TRUE;

	// Given pValue, determine how big it is
	// Then allocate a new buffer for m_pValue and copy...
	nReps = 1;
	cbValue = 0;
	pCur = (LPBYTE)pValue;
	if (m_dwType & VT_VECTOR)
	{
		// The next DWORD is a count of the elements
		nReps = *(LPDWORD)pValue;
		cb = sizeof( nReps );
		pCur += cb;
		cbValue += cb;
		dwType &= ~VT_VECTOR;
	}
	else
	{
		// If we get any of the string-like types,
		// and we are not a vector create a count-prefixed
		// buffer.
		switch (dwType )
		{
			case VT_LPSTR:          // null terminated string      
				pValueOrig = pValue;
				pValue = CountPrefixedStringA( (LPSTR)pValueOrig );
				pCur = (LPBYTE)pValue;
			break;

			case VT_BSTR:           // binary string               
			case VT_STREAM:         // Name of the stream follows  
			case VT_STORAGE:        // Name of the storage follows 
			case VT_STREAMED_OBJECT:// Stream contains an object   
			case VT_STORED_OBJECT:  // Storage contains an object  
				pValueOrig = pValue;
				pValue = CountPrefixedStringT( (LPTSTR)pValueOrig );
				pCur = (LPBYTE)pValue;
			break;

			case VT_LPWSTR:         // UNICODE string 
				pValueOrig = pValue;
				pValue = CountPrefixedStringW( (LPWSTR)pValueOrig );
				pCur = (LPBYTE)pValue;
			break;
		}
	}

	// Since a value can be made up of a vector (VT_VECTOR) of
	// items, we first seek through the value, picking out
	// each item, getting it's size.
	//
	cbItem = 0;        // Size of the current item
	while (nReps--)
	{
		switch (dwType)
		{
			case VT_EMPTY:          // nothing                     
				cbItem = 0;
			break;

			case VT_I2:             // 2 byte signed int           
			case VT_BOOL:           // True=-1, False=0            
				cbItem = 2;
			break;

			case VT_I4:             // 4 byte signed int           
			case VT_R4:             // 4 byte real                 
				cbItem = 4;
			break;

			case VT_R8:             // 8 byte real                 
			case VT_CY:             // currency                    
			case VT_DATE:           // date                        
			case VT_I8:             // signed 64-bit int           
			case VT_FILETIME:       // FILETIME                    
				cbItem = 8;
			break;

			case VT_CLSID:          // A Class ID                  
				cbItem = sizeof(CLSID);
			break;

#ifndef _UNICODE
			case VT_BSTR:           // binary string               
			case VT_STREAM:         // Name of the stream follows  
			case VT_STORAGE:        // Name of the storage follows 
			case VT_STREAMED_OBJECT:// Stream contains an object   
			case VT_STORED_OBJECT:  // Storage contains an object  
			case VT_STREAMED_PROPSET:// Stream contains a propset  
			case VT_STORED_PROPSET: // Storage contains a propset  
#endif // _UNICODE
			case VT_LPSTR:          // null terminated string      
			case VT_BLOB_OBJECT:    // Blob contains an object     
			case VT_BLOB_PROPSET:   // Blob contains a propset     
			case VT_BLOB:           // Length prefixed bytes       
			case VT_CF:             // Clipboard format            
				// Get the DWORD that gives us the size, making
				// sure we increment cbValue.
				cbItem = *(LPDWORD)pCur;
				cb = sizeof(cbItem);
				pCur += cb;
				cbValue += cb;
			break;

#ifdef _UNICODE
			case VT_BSTR:           // binary string               
			case VT_STREAM:         // Name of the stream follows  
			case VT_STORAGE:        // Name of the storage follows 
			case VT_STREAMED_OBJECT:// Stream contains an object   
			case VT_STORED_OBJECT:  // Storage contains an object  
			case VT_STREAMED_PROPSET:// Stream contains a propset  
			case VT_STORED_PROPSET: // Storage contains a propset  
#endif // _UNICODE
			case VT_LPWSTR:         // UNICODE string 
				cbItem = *(LPDWORD)pCur * sizeof(WCHAR);
				cb = sizeof( cbItem );
				pCur += cb;
				cbValue += cb;
			break;
	        case VT_VARIANT:        // VARIANT*                
	        break;

			default:
				if (pValueOrig)
					free( pValue );
				return FALSE;
		}

		// Add 'cb' to cbItem before seeking...
		//
		// Seek to the next item
		pCur += cbItem;
		cbValue += cbItem;
	}

	if (NULL == AllocValue(cbValue))
	{
		TRACE0("CProperty::AllocValue failed");
		return FALSE;
	}
	memcpy( m_pValue, pValue, (int)cbValue );

	if (pValueOrig)
		free( pValue );

	return TRUE;
}

LPVOID CProperty::Get( void )
{   return Get( (DWORD*)NULL );   }

LPVOID CProperty::Get( DWORD* pcb )
{
	DWORD   cb;
	LPBYTE  p = NULL;

	p = (LPBYTE)m_pValue;

	// m_pValue points to a Property "Value" which may
	// have size information included...
	switch( m_dwType )
	{
		case VT_EMPTY:          // nothing                     
			cb = 0;
		break;

		case VT_I2:             // 2 byte signed int           
		case VT_BOOL:           // True=-1, False=0            
			cb = 2;
		break;

		case VT_I4:             // 4 byte signed int           
		case VT_R4:             // 4 byte real                 
			cb = 4;
		break;

		case VT_R8:             // 8 byte real                 
		case VT_CY:             // currency                    
		case VT_DATE:           // date                        
		case VT_I8:             // signed 64-bit int           
		case VT_FILETIME:       // FILETIME                    
			cb = 8;
		break;

#ifndef _UNICODE
		case VT_BSTR:           // binary string               
		case VT_STREAM:         // Name of the stream follows  
		case VT_STORAGE:        // Name of the storage follows 
		case VT_STREAMED_OBJECT:// Stream contains an object   
		case VT_STORED_OBJECT:  // Storage contains an object  
		case VT_STREAMED_PROPSET:// Stream contains a propset  
		case VT_STORED_PROPSET: // Storage contains a propset  
#endif // UNICODE
		case VT_LPSTR:          // null terminated string      
		case VT_CF:             // Clipboard format            
			// Read the DWORD that gives us the size, making
			// sure we increment cbValue.
			cb = *(LPDWORD)p;
			p += sizeof( DWORD );
		break;

		case VT_BLOB:           // Length prefixed bytes       
		case VT_BLOB_OBJECT:    // Blob contains an object     
		case VT_BLOB_PROPSET:   // Blob contains a propset     
			// Read the DWORD that gives us the size.
			cb = *(LPDWORD)p;
		break;

#ifdef _UNICODE
		case VT_BSTR:           // binary string               
		case VT_STREAM:         // Name of the stream follows  
		case VT_STORAGE:        // Name of the storage follows 
		case VT_STREAMED_OBJECT:// Stream contains an object   
		case VT_STORED_OBJECT:  // Storage contains an object  
		case VT_STREAMED_PROPSET:// Stream contains a propset  
		case VT_STORED_PROPSET: // Storage contains a propset  
#endif // _UNICODE
		case VT_LPWSTR:         // UNICODE string 
			cb = *(LPDWORD)p * sizeof(WCHAR);
			p += sizeof( DWORD );
		break;

		case VT_CLSID:          // A Class ID                  
			cb = sizeof(CLSID);
		break;

        case VT_VARIANT:        // VARIANT*                
        break;

		default:
			return NULL;
	}
	if (pcb != NULL)
		*pcb = cb;

	return p;
}

DWORD  CProperty::GetType( void )
{   return m_dwType;  }

void   CProperty::SetType( DWORD dwType )
{   m_dwType = dwType; }

DWORD CProperty::GetID( void )
{   return m_dwPropID;   }

void CProperty::SetID( DWORD dwPropID )
{    m_dwPropID = dwPropID;   }

LPVOID CProperty::GetRawValue( void )
{   return m_pValue; }

BOOL CProperty::WriteToStream( IStream* pIStream )
{
	ULONG           cb;
	ULONG           cbTotal; // Total size of the whole value
	DWORD           dwType = m_dwType;
	DWORD           nReps;
	LPBYTE          pValue;
	LPBYTE          pCur;
	BOOL            bSuccess = FALSE;
	BYTE            b = 0;

	nReps = 1;
	pValue = (LPBYTE)m_pValue;
	pCur = pValue;
	cbTotal = 0;
	if (m_dwType & VT_VECTOR)
	{
		// Value is a DWORD count of elements followed by
		// that many repititions of the value.
		//
		nReps = *(LPDWORD)pCur;
		cbTotal = sizeof(DWORD);
		pCur += cbTotal;
		dwType &= ~VT_VECTOR;
	}

#ifdef _UNICODE
	switch (dwType)
	{
		case VT_BSTR:           // binary string               
		case VT_STREAM:         // Name of the stream follows  
		case VT_STORAGE:        // Name of the storage follows 
		case VT_STREAMED_OBJECT:// Stream contains an object   
		case VT_STORED_OBJECT:  // Storage contains an object  
		case VT_STREAMED_PROPSET:// Stream contains a propset  
		case VT_STORED_PROPSET: // Storage contains a propset  
			pValue = ConvertStringProp(pCur, m_dwType, nReps, sizeof(char));
			if (m_dwType & VT_VECTOR)
				pCur = pValue + sizeof(DWORD);
		break;
	}
#endif // _UNICODE

	// Figure out how big the data is.
	while (nReps--)
	{
		switch (dwType)
		{
			case VT_EMPTY:          // nothing                     
				cb = 0;
			break;

			case VT_I2:             // 2 byte signed int           
			case VT_BOOL:           // True=-1, False=0            
				cb = 2;
			break;

			case VT_I4:             // 4 byte signed int           
			case VT_R4:             // 4 byte real                 
				cb = 4;
			break;

			case VT_R8:             // 8 byte real                 
			case VT_CY:             // currency                    
			case VT_DATE:           // date                        
			case VT_I8:             // signed 64-bit int           
			case VT_FILETIME:       // FILETIME                    
				cb = 8;
			break;

			case VT_LPSTR:          // null terminated string      

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色一区在线观看| 国产精品精品国产色婷婷| 亚洲欧洲国产专区| 精品视频资源站| 国产精品二三区| 欧美亚洲图片小说| 一区二区在线免费| 一本一本大道香蕉久在线精品 | 成年人国产精品| 日韩激情视频在线观看| 国产精品久久久久影院亚瑟| 精品一区二区在线观看| 亚洲人精品午夜| 久久九九久精品国产免费直播| 欧美日韩精品高清| 日韩成人精品在线| 亚洲曰韩产成在线| 国产精品福利一区| 国产欧美日韩精品一区| 欧美一区二区观看视频| 日本二三区不卡| 99久久亚洲一区二区三区青草| 国产一区二区在线看| 午夜私人影院久久久久| 亚洲精品一二三| 成人免费小视频| 国产精品色婷婷久久58| 久久天堂av综合合色蜜桃网| 欧美一区二区三区免费视频 | 欧美日韩免费一区二区三区视频| 99久久久免费精品国产一区二区 | 五月激情六月综合| 欧美韩国日本综合| 日韩视频在线你懂得| 欧美日产在线观看| 色综合一个色综合| 国产精品一品二品| 日韩激情一区二区| 一片黄亚洲嫩模| 久久婷婷国产综合精品青草| 欧美成人国产一区二区| 色伊人久久综合中文字幕| 粉嫩aⅴ一区二区三区四区| 性久久久久久久久| 亚洲日本中文字幕区| 久久久噜噜噜久噜久久综合| 欧美中文字幕一二三区视频| 国产999精品久久| 日韩高清不卡一区二区| 亚洲一区在线观看免费观看电影高清| 日韩你懂的在线播放| 黄色日韩三级电影| 国产黑丝在线一区二区三区| 无码av免费一区二区三区试看 | 欧美美女直播网站| 色哟哟精品一区| 久久电影网电视剧免费观看| 一区二区三区色| 亚洲啪啪综合av一区二区三区| 久久综合999| 精品国产免费一区二区三区香蕉| 欧美视频一区在线| 欧美综合一区二区| 色综合中文综合网| 国产综合久久久久久鬼色 | 8v天堂国产在线一区二区| 成人毛片老司机大片| 国产一区二区久久| 天堂一区二区在线免费观看| 麻豆精品在线播放| 另类小说图片综合网| 日本成人中文字幕| 图片区日韩欧美亚洲| 亚洲美女一区二区三区| 亚洲视频在线一区二区| 一区二区三区高清在线| 亚洲免费伊人电影| 亚洲欧美日韩国产手机在线 | 色综合网色综合| 一本在线高清不卡dvd| 91网站黄www| 97se亚洲国产综合在线| 青青草原综合久久大伊人精品 | 日韩精品专区在线影院观看| 8x8x8国产精品| 欧美一卡二卡在线| 日韩精品一区二区三区视频播放| 日韩欧美一区二区免费| 日韩精品一区二区三区视频| 中文字幕中文在线不卡住| 亚洲欧美一区二区三区孕妇| 亚洲国产精品自拍| 日韩精品福利网| 国产自产高清不卡| 成人av资源下载| 欧美调教femdomvk| 日本黄色一区二区| 中国色在线观看另类| 亚洲人成亚洲人成在线观看图片| 一区二区三区日韩欧美| 日本不卡视频在线| 国产aⅴ精品一区二区三区色成熟| 成人av影院在线| 欧美三级电影在线看| 欧美日韩一区二区三区在线看| 久久精品在线免费观看| 亚洲柠檬福利资源导航| 免费av网站大全久久| 国产成人精品网址| 91福利社在线观看| 精品免费一区二区三区| 欧美精品色综合| 国产精品女人毛片| 日韩成人一级片| 成a人片亚洲日本久久| 欧美三区在线观看| 精品成人一区二区三区四区| 亚洲精品中文在线观看| 亚洲欧洲国产日韩| 久久国产视频网| 成人精品视频一区二区三区 | 青草国产精品久久久久久| 国模冰冰炮一区二区| 色丁香久综合在线久综合在线观看| 欧美日韩国产小视频| 精品国精品国产| 一区二区三区中文在线| 国产日韩欧美激情| 亚洲在线视频免费观看| 久久99久久精品欧美| 91久久精品一区二区三| 精品国产免费一区二区三区四区 | 国产午夜亚洲精品羞羞网站| 亚洲综合成人网| 日韩黄色片在线观看| 偷拍日韩校园综合在线| 91黄色免费网站| 国产欧美精品一区| 蜜桃传媒麻豆第一区在线观看| 99精品一区二区| 日韩欧美电影一二三| 伊人性伊人情综合网| 国产aⅴ精品一区二区三区色成熟| 久久国产视频网| 国产成人午夜精品5599| 欧美人动与zoxxxx乱| 久久只精品国产| 亚洲自拍偷拍图区| av不卡免费电影| 国产欧美一区二区三区沐欲| 奇米综合一区二区三区精品视频| 国产在线视频精品一区| 色婷婷一区二区| 国产网站一区二区三区| 国产一区二区三区四| 日韩久久精品一区| 奇米一区二区三区| 欧美在线看片a免费观看| 久久精品视频网| 日韩激情av在线| 欧美日韩国产经典色站一区二区三区| 亚洲男人的天堂一区二区| 成人高清在线视频| 欧美国产欧美亚州国产日韩mv天天看完整| 久久99国产精品久久| 日韩美女视频一区二区在线观看| 曰韩精品一区二区| 精品欧美久久久| 精品中文av资源站在线观看| 欧美一级爆毛片| 五月天欧美精品| 91精品国产日韩91久久久久久| 亚洲一区二区五区| 波多野结衣中文字幕一区 | 夜夜揉揉日日人人青青一国产精品| 欧美日韩国产影片| 亚洲女人小视频在线观看| 一区二区三区日韩在线观看| 亚洲天堂av老司机| 91在线精品秘密一区二区| 专区另类欧美日韩| 成人av网站免费观看| 欧美视频一区二区三区| 亚洲成人久久影院| 欧美一级午夜免费电影| av中文一区二区三区| 国产精品大尺度| 欧美视频中文字幕| 欧美变态tickling挠脚心| 蜜臀久久久久久久| 欧美精品在欧美一区二区少妇 | 奇米精品一区二区三区在线观看 | 欧美日产国产精品| 欧美videos大乳护士334| 国产成人免费视| 中文字幕在线观看一区二区| 亚洲小少妇裸体bbw| 欧美老年两性高潮| 一区二区三区视频在线看| 国产一区欧美日韩|