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

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

?? activex.cpp

?? ReactOS是一些高手根據Windows XP的內核編寫出的類XP。內核實現機理和API函數調用幾乎相同。甚至可以兼容XP的程序。喜歡研究系統內核的人可以看一看。
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
#include "stdafx.h"

namespace MSTSCLib
{
#include "mstsclib_h.h"
};

namespace MSTSCLib_Redist
{
// extremely ew, but actually the cleanest way to import the alternate UUIDs
#include "mstsclib_redist_i.c"
};

#include "rdesktop/rdesktop.h"
#include "rdesktop/proto.h"

namespace
{
#ifdef _MSC_VER
extern "C" char __ImageBase;
#endif

HMODULE GetCurrentModule()
{
	return reinterpret_cast<HMODULE>(&__ImageBase);
}

}

namespace
{

LONG g_moduleRefCount = 0;

void lockServer()
{
	InterlockedIncrement(&g_moduleRefCount);
}

void unlockServer()
{
	InterlockedDecrement(&g_moduleRefCount);
}

bool canUnloadServer()
{
	return g_moduleRefCount == 0;
}

}

namespace
{

void FreeLpsz(LPSTR lpsz)
{
	if(lpsz)
		delete[] lpsz;
}

LPSTR AllocLpsz(const CHAR * lpsz, size_t cb)
{
	LPSTR lpszNew = new CHAR[cb + 1];

	if(lpszNew == NULL)
		return NULL;

	CopyMemory(lpszNew, lpsz, cb);
	lpszNew[cb] = 0;

	return lpszNew;
}

LPSTR AllocLpsz(const WCHAR * lpwsz, int cchIn)
{
	int cch = WideCharToMultiByte(CP_ACP, 0, lpwsz, cchIn, NULL, 0, NULL, NULL);

	if(cch <= 0)
		return NULL;

	LPSTR lpsz = new CHAR[cch];

	if(lpsz == NULL)
		return NULL;

	cch = WideCharToMultiByte(CP_ACP, 0, lpwsz, cchIn, lpsz, cch, NULL, NULL);

	if(cch <= 0)
	{
		FreeLpsz(lpsz);
		return NULL;
	}

	return lpsz;
}

LPSTR BstrToLpsz(BSTR bstr)
{
	return AllocLpsz(bstr, SysStringLen(bstr));
}

BSTR LpszToBstr(LPSTR lpsz)
{
	int cch = MultiByteToWideChar(CP_ACP, 0, lpsz, -1, NULL, 0);

	if(cch <= 0)
		return NULL;

	BSTR bstr = SysAllocStringLen(NULL, cch);

	if(bstr == NULL)
		return NULL;

	cch = MultiByteToWideChar(CP_ACP, 0, lpsz, -1, bstr, cch);

	if(cch <= 0)
	{
		SysFreeString(bstr);
		return NULL;
	}

	return bstr;
}

}

namespace
{

template<class T, class U> T aligndown(const T& X, const U& align)
{
	return X & ~(T(align) - 1);
}

template<class T, class U> T alignup(const T& X, const U& align)
{
	return aligndown(X + (align - 1), align);
}

/* Convert between bitmap formats */
uint8 * win32_convert_scanlines(int width, int height, int bitcount, int fromalign, int toalign, const uint8 * data, uint8 ** buffer)
{
	// TBD: profile & optimize the most common cases
	assert(width > 0);
	assert(height);
	assert(bitcount && bitcount <= 32);
	assert(fromalign <= toalign);
	assert(data);
	assert(buffer);

	bool flipped = height < 0;

	if(flipped)
		height = - height;

	int bytesperrow = alignup(width * bitcount, 8) / 8;
	int fromstride = alignup(bytesperrow, fromalign);
	int tostride = alignup(bytesperrow, toalign);
	assert(fromstride <= tostride);

	int datasize = tostride * height;

	uint8 * dibits = new uint8[datasize];

	const uint8 * src = data;
	uint8 * dest = dibits;

	const int pad = tostride - fromstride;

	assert(pad < 4);
	__assume(pad < 4);

	if(flipped)
	{
		dest += (height - 1) * tostride;
		tostride = - tostride;
	}

	for(int i = 0; i < height; ++ i)
	{
		memcpy(dest, src, fromstride);
		memset(dest + fromstride, 0, pad);
		src += fromstride;
		dest += tostride;
	}

	*buffer = dibits;
	return dibits;
}

/* Creates bitmaps */
HBITMAP win32_create_dib(LONG width, LONG height, WORD bitcount, const BYTE * data)
{
	struct b_
	{
		BITMAPINFO bmi;
		RGBQUAD colormap[256 - ARRAYSIZE(RTL_FIELD_TYPE(BITMAPINFO, bmiColors))];
	}
	b;

	b.bmi.bmiHeader.biSize = sizeof(b.bmi.bmiHeader);
	b.bmi.bmiHeader.biWidth = width;
	b.bmi.bmiHeader.biHeight = height;
	b.bmi.bmiHeader.biPlanes = 1;
	b.bmi.bmiHeader.biBitCount = bitcount;
	b.bmi.bmiHeader.biCompression = BI_RGB;
	b.bmi.bmiHeader.biSizeImage = 0;
	b.bmi.bmiHeader.biXPelsPerMeter = 0;
	b.bmi.bmiHeader.biYPelsPerMeter = 0;

	if(bitcount > 8)
	{
		b.bmi.bmiHeader.biClrUsed = 0;
		b.bmi.bmiHeader.biClrImportant = 0;
	}
	else
	{
		b.bmi.bmiHeader.biClrUsed = 2 << bitcount;
		b.bmi.bmiHeader.biClrImportant = 2 << bitcount;

		// TODO: palette
	}

	// FIXME: beyond ugly
	HDC hdc = CreateCompatibleDC(NULL);

	if(hdc == NULL)
		return NULL;

	HBITMAP hbm = CreateDIBitmap(hdc, &b.bmi.bmiHeader, CBM_INIT, data, &b.bmi, DIB_RGB_COLORS);

	if(hbm == NULL)
		error("CreateDIBitmap %dx%dx%d failed\n", width, height, bitcount);

	DeleteDC(hdc);
	return hbm;
}

/* Creates brushes */
HBRUSH win32_create_brush(BRUSH * brush, COLORREF fgcolour)
{
	if(brush == NULL)
		return (HBRUSH)GetStockObject(NULL_BRUSH);

	switch(brush->style)
	{
	case BS_SOLID:
	case BS_NULL:
	case BS_HATCHED:
	case BS_PATTERN:
	case BS_PATTERN8X8:
		break;

	default:
		return NULL;
	}

	switch(brush->style)
	{
	case BS_SOLID:
		return CreateSolidBrush(fgcolour);

	case BS_HATCHED:
		return CreateHatchBrush(brush->pattern[0], fgcolour);

	case BS_NULL:
		return (HBRUSH)GetStockObject(NULL_BRUSH);

	case BS_PATTERN:
	case BS_PATTERN8X8:
		{
			uint16 pattern[8];

			for(size_t i = 0; i < 8; ++ i)
				pattern[i] = brush->pattern[i];

			HBITMAP hpattern = CreateBitmap(8, 8, 1, 1, pattern);
			HBRUSH hbr = CreatePatternBrush(hpattern);
			DeleteObject(hpattern);
			return hbr;
		}

	DEFAULT_UNREACHABLE;
	}
}
};

/*
	"sealed" can improve optimizations by asserting a class cannot be derived
	from, optimizing out accesses to the v-table from inside the class
*/
#if defined(_MSC_VER) && _MSC_VER >= 1400
#define SEALED_ sealed
#else
#define SEALED_
#endif


/* Class that implements the RDP client GUI */
class RdpClientUI
{
public:
	// TODO: pass the client settings relevant to the GUI here
	HRESULT Initialize(HWND hwndParent)
	{
		// TODO: create the various windows
		// TODO: create display window thread
		// TODO: create input thread
		return E_FAIL;
	}

public:
	static BOOL Startup()
	{
		WNDCLASSEX wcexUI = { sizeof(wcexUI) };
		WNDCLASSEX wcexConsole = { sizeof(wcexConsole) };
		WNDCLASSEX wcexDisplay = { sizeof(wcexDisplay) };
		WNDCLASSEX wcexInput = { sizeof(wcexInput) };

		HBRUSH nullBrush = (HBRUSH)GetStockObject(HOLLOW_BRUSH);

		wcexUI.lpfnWndProc = NULL; // TODO
		wcexUI.hInstance = GetCurrentModule();
		wcexUI.hCursor = LoadCursor(NULL, IDC_ARROW);
		wcexUI.hbrBackground = nullBrush;
		wcexUI.lpszClassName = TEXT("MissTosca_UI");

		wcexConsole.style = CS_VREDRAW | CS_HREDRAW;
		wcexConsole.lpfnWndProc = NULL; // TODO
		wcexConsole.hInstance = GetCurrentModule();
		wcexConsole.hCursor = LoadCursor(NULL, IDC_ARROW);
		wcexConsole.hbrBackground = nullBrush;
		wcexConsole.lpszClassName = TEXT("MissTosca_Console");

		wcexDisplay.style = CS_VREDRAW | CS_HREDRAW;
		wcexDisplay.lpfnWndProc = NULL; // TODO
		wcexDisplay.hInstance = GetCurrentModule();
		wcexDisplay.hCursor = LoadCursor(NULL, IDC_ARROW);
		wcexDisplay.hbrBackground = nullBrush;
		wcexDisplay.lpszClassName = TEXT("MissTosca_Display");
		
		wcexInput.style = CS_VREDRAW | CS_HREDRAW;
		wcexInput.lpfnWndProc = NULL; // TODO
		wcexInput.hInstance = GetCurrentModule();
		wcexInput.hCursor = NULL;
		wcexInput.hbrBackground = nullBrush;
		wcexInput.lpszClassName = TEXT("MissTosca_Input");

		return
			RegisterClassEx(&wcexUI) &&
			RegisterClassEx(&wcexConsole) &&
			RegisterClassEx(&wcexDisplay) &&
			RegisterClassEx(&wcexInput);
	}

	static void Shutdown()
	{
		// TODO
	}

	/*
		This is the main UI window. It's the direct child of the control
		window, it fills its whole extent and it contains the scrollbars.
		When activated, it will move keyboard focus to the input window
	*/
private:
	HWND m_uiWindow;
	LONG m_scrollHPos;
	LONG m_scrollVPos;

	LRESULT UIWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		switch(uMsg)
		{
			// Keep the keyboard focus on the input window
		case WM_ACTIVATE:
			switch(LOWORD(wParam))
			{
			case WA_INACTIVE:
				break;

			case WA_ACTIVE:
			case WA_CLICKACTIVE:
				if(!HIWORD(wParam))
					SetFocus(m_inputWindow);
			}

			return 0;

			// Resized: rearrange children windows, adjust scrollbars
		case WM_SIZE:
			{
				if(IsIconic(m_uiWindow))
					break;

				RECT rcClient;
				GetWindowRect(m_uiWindow, &rcClient);

				if(m_smartSizing)
				{
					// we are not supposed to maintain aspect ratio. Container has to do that
					m_consoleX = 0;
					m_consoleY = 0;
					m_consoleWidth = rcClient.right;
					m_consoleHeight = rcClient.bottom;
				}
				else
				{
					// center horizontally, no horizontal scrollbar
					if(rcClient.right >= m_consoleWidth)
						m_consoleX = (m_consoleWidth - rcClient.right) / 2;

					// center vertically, no vertical scrollbar
					if(rcClient.bottom >= m_consoleHeight)
						m_consoleY = (m_consoleHeight - rcClient.right) / 2;
				}

				SCROLLINFO scroll = { sizeof(scroll), SIF_ALL, 0 };
			
				// update the horizontal scrollbar
				scroll.nMax = m_consoleWidth;
				scroll.nPage = rcClient.right;
				scroll.nPos = 0 - m_consoleX;
				SetScrollInfo(m_uiWindow, SB_HORZ, &scroll, TRUE);

				// update the vertical scrollbar
				scroll.nMax = m_consoleHeight;
				scroll.nPage = rcClient.bottom;
				scroll.nPos = 0 - m_consoleY;
				SetScrollInfo(m_uiWindow, SB_VERT, &scroll, TRUE);

				// move/resize the console window
				MoveWindow(m_consoleWindow, m_consoleX, m_consoleY, m_consoleWidth, m_consoleHeight, TRUE);
			}

			return 0;

		case WM_HSCROLL:
			{
				SCROLLINFO scroll = { sizeof(scroll), SIF_TRACKPOS };
				GetScrollInfo(m_uiWindow, SB_HORZ, &scroll);
				m_consoleX = - scroll.nTrackPos;
				MoveWindow(m_consoleWindow, m_consoleX, m_consoleY, m_consoleWidth, m_consoleHeight, TRUE);
			}

			return 0;

		case WM_VSCROLL:
			{
				SCROLLINFO scroll = { sizeof(scroll), SIF_TRACKPOS };
				GetScrollInfo(m_uiWindow, SB_VERT, &scroll);
				m_consoleY = - scroll.nTrackPos;
				MoveWindow(m_consoleWindow, m_consoleX, m_consoleY, m_consoleWidth, m_consoleHeight, TRUE);
			}

			return 0;

		default:
			break;
		}

		return DefWindowProc(m_uiWindow, uMsg, wParam, lParam);
	}

	/*
		This is the full-screen title bar. It's displayed at the top of the
		main UI window while in full-screen mode, and it contains two toolbars
		with the pin, minimize, restore and close buttons
	*/
	HWND m_fullScreenBarWindow;

	/*
		This is the console window. It has the same extent as the display on
		the remote computer, or it fills the UI window in smart resizing mode,
		and it contains the input and display windows
	*/
private:
	HWND m_consoleWindow;
	LONG m_consoleX;
	LONG m_consoleY;
	LONG m_consoleWidth;
	LONG m_consoleHeight;
	bool m_smartSizing;

	LRESULT ConsoleWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		switch(uMsg)
		{
		case WM_SIZE:
			{
				RECT rcClient;
				GetClientRect(m_consoleWindow, &rcClient);

				MoveWindow(m_inputWindow, 0, 0, rcClient.right, rcClient.bottom, TRUE);
				MoveWindow(m_displayWindow, 0, 0, rcClient.right, rcClient.bottom, TRUE);
			}

			return 0;

		default:
			break;
		}

		return DefWindowProc(m_consoleWindow, uMsg, wParam, lParam);
	}

	/*
		This is the display window. It represents the virtual display of the
		remote computer. It completely fills its parent, the console window,
		and it runs in its own thread for performance reasons
	*/
private:
	HWND m_displayWindow;
	LONG m_displayBufferWidth;
	LONG m_displayBufferHeight;
	HDC m_displayBuffer;
	void * m_displayBufferRaw;
	int m_displayBufferSave;
	int m_displayBufferBitDepth;
	int m_displayBufferByteDepth;
	int m_displayBufferStride;
	RECT m_displayBufferClip;
	CRITICAL_SECTION m_displayBufferMutex;

	LRESULT DisplayWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		switch(uMsg)
		{
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;

		case WM_PRINTCLIENT:
			if(wParam == 0)
				break;

		case WM_PAINT:
			{
				HDC hdc = (HDC)wParam;

				EnterCriticalSection(&m_displayBufferMutex);

				if(hdc)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品高清视频在线观看| 国模套图日韩精品一区二区| 欧美aⅴ一区二区三区视频| 国产不卡高清在线观看视频| 91免费看片在线观看| 日韩精品一区二区在线观看| 亚洲综合色视频| 国产精品自拍三区| 欧美一级淫片007| 一区二区三区电影在线播| 国产成人在线网站| 日韩一二三区视频| 亚洲在线成人精品| 99国产精品国产精品毛片| 精品成人一区二区三区四区| 午夜精品久久久久影视| 94-欧美-setu| 中文字幕一区三区| 国产成人精品免费一区二区| 日韩欧美在线不卡| 午夜视频在线观看一区二区| 色哟哟一区二区三区| 国产精品久久久久久久久果冻传媒 | 欧美中文字幕一二三区视频| 国产午夜精品在线观看| 久久99热这里只有精品| 欧美日韩一二三区| 一区二区三区高清| 欧美在线影院一区二区| 亚洲精品视频在线看| 色婷婷精品大视频在线蜜桃视频| 欧美极品xxx| 国产91精品在线观看| 久久久欧美精品sm网站| 国产尤物一区二区在线 | 91网站黄www| 中文字幕一区二区三区av| av中文一区二区三区| 日本一区二区久久| 99视频精品在线| 亚洲综合成人在线视频| 欧美色窝79yyyycom| 日本亚洲最大的色成网站www| 欧美精品九九99久久| 蜜桃一区二区三区在线| 久久理论电影网| 97久久精品人人爽人人爽蜜臀| 一区在线观看视频| 欧美视频一区在线| 免费观看在线色综合| 久久夜色精品国产欧美乱极品| 国产精品一二三在| 亚洲日韩欧美一区二区在线| 欧美亚洲综合久久| 久久国产精品无码网站| 国产欧美日韩综合| 在线观看www91| 免费观看一级欧美片| 中文字幕欧美国产| 欧美在线一区二区三区| 久久激情五月激情| 亚洲日本在线视频观看| 欧美日本一区二区| 国产在线精品一区二区不卡了| 中文字幕在线观看不卡视频| 94-欧美-setu| 精品无人码麻豆乱码1区2区| 亚洲天天做日日做天天谢日日欢 | 亚洲综合在线免费观看| 欧美一三区三区四区免费在线看 | 麻豆久久久久久| 国产精品青草综合久久久久99| 欧美综合天天夜夜久久| 久久精工是国产品牌吗| 亚洲欧美精品午睡沙发| 欧美成人精品高清在线播放| 97久久超碰国产精品电影| 日产国产高清一区二区三区| 日韩一区欧美小说| 2021中文字幕一区亚洲| 精品视频1区2区| youjizz国产精品| 狠狠色狠狠色综合系列| 一区二区视频在线| 国产日韩欧美a| 欧美一级黄色片| 日本久久一区二区| 高潮精品一区videoshd| 奇米色一区二区三区四区| 亚洲自拍欧美精品| 亚洲欧美日韩精品久久久久| 国产天堂亚洲国产碰碰| 日韩视频在线你懂得| 在线看不卡av| 99国内精品久久| 成人黄色国产精品网站大全在线免费观看| 亚洲va韩国va欧美va精品 | 日韩av成人高清| 亚洲一区在线观看免费 | 欧美专区日韩专区| 成人丝袜18视频在线观看| 免费在线看一区| 同产精品九九九| 亚洲妇女屁股眼交7| 亚洲人午夜精品天堂一二香蕉| 国产亚洲福利社区一区| www一区二区| 久久影院电视剧免费观看| 欧美一级二级在线观看| 欧美亚洲国产一区二区三区va| av电影在线观看一区| 国产成人一区在线| 国产精品亚洲综合一区在线观看| 久久av资源站| 韩国视频一区二区| 国产自产高清不卡| 懂色中文一区二区在线播放| 丰满亚洲少妇av| 成人免费观看视频| av毛片久久久久**hd| 色婷婷亚洲婷婷| 欧美日韩卡一卡二| 6080日韩午夜伦伦午夜伦| 在线综合亚洲欧美在线视频| 欧美一区二区三区免费| 精品电影一区二区三区| 国产精品毛片久久久久久久| 亚洲欧洲日韩一区二区三区| 国产精品免费av| 亚洲一区二区三区精品在线| 午夜激情综合网| 九色综合国产一区二区三区| 国产精品99久久久久久似苏梦涵| 成人综合婷婷国产精品久久蜜臀| 国产69精品久久久久毛片| 91免费看片在线观看| 欧美日韩综合色| 日韩欧美一级二级三级| 中文字幕欧美日韩一区| 一区二区三区四区激情| 日韩国产成人精品| 国产91丝袜在线18| 色88888久久久久久影院野外| 欧美精品1区2区| 久久久久久久综合狠狠综合| 成人免费在线视频| 日本中文字幕一区二区视频| 国产精品一区二区在线观看网站| 91丝袜美腿高跟国产极品老师 | 91福利在线导航| 欧美一区欧美二区| 欧美经典三级视频一区二区三区| 亚洲欧美另类图片小说| 久久国产剧场电影| 91美女片黄在线观看| 日韩午夜小视频| 亚洲日本在线天堂| 韩国一区二区在线观看| 色婷婷av一区| 国产婷婷色一区二区三区四区 | 亚洲日本在线观看| 国产真实乱对白精彩久久| 一本大道久久a久久精品综合| 欧美猛男gaygay网站| 国产欧美精品一区aⅴ影院| 亚洲.国产.中文慕字在线| 北条麻妃国产九九精品视频| 欧美变态tickle挠乳网站| 亚洲六月丁香色婷婷综合久久| 精品亚洲欧美一区| 4438成人网| 一区二区三区 在线观看视频| 韩国三级中文字幕hd久久精品| 欧美日韩综合一区| 亚洲特级片在线| 国产成人啪免费观看软件| 精品久久久久香蕉网| 亚洲高清免费视频| 91福利在线播放| 亚洲人精品一区| 99久久精品国产一区| 久久免费午夜影院| 久久精品二区亚洲w码| 67194成人在线观看| 亚洲一区二区三区自拍| 色综合天天在线| 国产精品理论片在线观看| 国产河南妇女毛片精品久久久| 欧美xxxx老人做受| 麻豆精品久久精品色综合| 91精品国产高清一区二区三区| 午夜激情综合网| 这里只有精品电影| 美腿丝袜亚洲三区| 日韩女优毛片在线| 国产综合色在线| 欧美精品一区二| 国产精品亚洲成人| 国产精品系列在线| 9人人澡人人爽人人精品|