Initial commit: ROW Client source code

Game client codebase including:
- CharacterActionControl: Character and creature management
- GlobalScript: Network, items, skills, quests, utilities
- RYLClient: Main client application with GUI and event handlers
- Engine: 3D rendering engine (RYLGL)
- MemoryManager: Custom memory allocation
- Library: Third-party dependencies (DirectX, boost, etc.)
- Tools: Development utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 16:24:34 +09:00
commit e067522598
5135 changed files with 1745744 additions and 0 deletions

View File

@@ -0,0 +1,156 @@
# Microsoft Developer Studio Project File - Name="DMOEnum" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=DMOEnum - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "DMOEnum.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "DMOEnum.mak" CFG="DMOEnum - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "DMOEnum - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "DMOEnum - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "DMOEnum - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" /d "WIN32"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 strmiids.lib msdmo.lib dmoguids.lib /nologo /subsystem:windows /machine:I386 /stack:0x200000,0x200000
!ELSEIF "$(CFG)" == "DMOEnum - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" /d "WIN32"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 strmiids.lib msdmo.lib dmoguids.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x200000,0x200000
!ENDIF
# Begin Target
# Name "DMOEnum - Win32 Release"
# Name "DMOEnum - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\DMOEnum.cpp
# End Source File
# Begin Source File
SOURCE=.\DMOEnum.rc
# End Source File
# Begin Source File
SOURCE=.\DMOEnumDlg.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Common\namedguid.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\DMOEnum.h
# End Source File
# Begin Source File
SOURCE=.\DMOEnumDlg.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\namedguid.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\DMOEnum.ico
# End Source File
# Begin Source File
SOURCE=.\res\DMOEnum.rc2
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,270 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\DMOEnum.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\DMOEnum.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 73
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About DMOEnum"
FONT 8, "MS Shell Dlg"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "DMOEnum Version 8.1",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2000-2001 Microsoft Corporation",
IDC_STATIC,40,25,188,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
LTEXT "This sample enumerates DirectX Media Objects (DMOs) by category, using the DMOEnum and IEnumDMO interfaces.",
IDC_STATIC,42,39,186,27
END
IDD_DMOENUM_DIALOG DIALOGEX 0, 0, 539, 216
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "DMO Enumerator Sample"
FONT 8, "MS Shell Dlg"
BEGIN
LISTBOX IDC_LIST_DEVICES,7,18,113,67,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
LISTBOX IDC_LIST_FILTERS,127,18,136,116,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
LISTBOX IDC_LIST_INPUT_STREAMS,7,97,51,26,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
LISTBOX IDC_LIST_OUTPUT_STREAMS,69,97,51,26,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL "&Include Keyed DMOs?",IDC_CHECK_KEYED,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,11,126,107,10
EDITTEXT IDC_STATIC_FILENAME,40,140,223,14,ES_AUTOHSCROLL |
ES_READONLY
LISTBOX IDC_LIST_INPUT_TYPES,7,168,258,39,LBS_SORT |
LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
LISTBOX IDC_LIST_OUTPUT_TYPES,272,168,258,39,LBS_SORT |
LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
CHECKBOX "Supports quality control?",IDC_CHECK_IN_SUPPORTS_QC,281,
18,111,10
CHECKBOX "Requires whole samples?",IDC_CHECK_IN_WHOLE_SAMPLES,281,
29,111,10
CHECKBOX "One sample per buffer?",IDC_CHECK_IN_ONESAMPLE,281,40,
111,10
CHECKBOX "Fixed sample size?",IDC_CHECK_IN_FIXED,281,51,111,10
CHECKBOX "Holds buffers (for lookahead)?",
IDC_CHECK_IN_HOLDSBUFFERS,281,62,111,10
CHECKBOX "Supports quality control?",IDC_CHECK_OUT_SUPPORTS_QC,
409,18,111,10
CHECKBOX "Requires whole samples?",IDC_CHECK_OUT_WHOLE_SAMPLES,
409,29,111,10
CHECKBOX "One sample per buffer?",IDC_CHECK_OUT_ONESAMPLE,409,40,
111,10
CHECKBOX "Fixed sample size?",IDC_CHECK_OUT_FIXED,409,51,111,10
CHECKBOX "Discardable stream?",IDC_CHECK_OUT_DISCARDABLE,409,62,
111,10
CHECKBOX "Optional stream?",IDC_CHECK_OUT_OPTIONAL,409,73,111,10
CTEXT "DMO Categories",IDC_STATIC_CLASSES,7,5,113,8
CTEXT "Registered DMOs",IDC_STATIC_FILTERS,127,5,136,8
LTEXT "Server :",IDC_STATIC,7,143,32,8
LTEXT "Output Type/Subtype GUIDs:",IDC_STATIC,272,159,97,8
LTEXT "Input Type/Subtype GUIDs:",IDC_STATIC,7,159,97,8
LTEXT "0",IDC_STATIC_NUM_ITYPES,110,159,19,8
LTEXT "0",IDC_STATIC_NUM_OTYPES,375,159,19,8
LTEXT "In Streams: 0",IDC_STATIC_INPUT_STREAMS,7,88,51,8
LTEXT "Out Streams: 0",IDC_STATIC_OUTPUT_STREAMS,69,88,51,8
GROUPBOX "Input",IDC_STATIC,273,7,125,148
CTEXT "Preferred Media Type:",IDC_STATIC,278,87,116,8
CTEXT "",IDC_STATIC_IN_TYPE,278,96,116,10,SS_SUNKEN
CTEXT "Preferred Media Type:",IDC_STATIC,407,87,116,8
CTEXT ".",IDC_STATIC_OUT_TYPE,407,96,116,10,SS_SUNKEN
CTEXT "Preferred Media Subtype:",IDC_STATIC,278,108,116,8
CTEXT "Preferred Media Subtype:",IDC_STATIC,407,108,116,8
CTEXT "",IDC_STATIC_IN_SUBTYPE,278,118,116,10,SS_SUNKEN
CTEXT "",IDC_STATIC_OUT_SUBYTPE,407,118,116,10,SS_SUNKEN
CTEXT "Preferred Media Format:",IDC_STATIC,278,130,116,8
CTEXT "",IDC_STATIC_IN_FORMAT,278,139,116,10,SS_SUNKEN
CTEXT "Preferred Media Format:",IDC_STATIC,407,130,116,8
CTEXT "",IDC_STATIC_OUT_FORMAT,407,139,116,10,SS_SUNKEN
GROUPBOX "Output",IDC_STATIC,404,7,125,148
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 8,1,0,0
PRODUCTVERSION 8,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "DirectShow Sample\0"
VALUE "CompanyName", "Microsoft\0"
VALUE "FileDescription", "DMOEnum MFC Application\0"
VALUE "FileVersion", "8.10\0"
VALUE "InternalName", "DMOEnum\0"
VALUE "LegalCopyright", "Copyright (C) 2000-2001 Microsoft Corporation\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "DMOEnum.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "DirectX 8 SDK\0"
VALUE "ProductVersion", "8.1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 66
END
IDD_DMOENUM_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 532
TOPMARGIN, 7
BOTTOMMARGIN, 209
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ABOUTBOX "&About DMOEnum..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\DMOEnum.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,13 @@
//
// SYSENUM.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// DMOEnum.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,26 @@
// 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__64C3B12B_EC0A_42DB_A8C9_DD2F30047836__INCLUDED_)
#define AFX_STDAFX_H__64C3B12B_EC0A_42DB_A8C9_DD2F30047836__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__64C3B12B_EC0A_42DB_A8C9_DD2F30047836__INCLUDED_)

View File

@@ -0,0 +1,74 @@
//------------------------------------------------------------------------------
// File: DMOEnum.cpp
//
// Desc: DirectShow sample code - an MFC based application for device
// enumeration.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "stdafx.h"
#include "DMOEnum.h"
#include "DMOEnumDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumApp
BEGIN_MESSAGE_MAP(CDMOEnumApp, CWinApp)
//{{AFX_MSG_MAP(CDMOEnumApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumApp construction
CDMOEnumApp::CDMOEnumApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CDMOEnumApp object
CDMOEnumApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumApp initialization
BOOL CDMOEnumApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
// In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
// their functionality is incorporated into Microsoft's 32-bit operating systems.
#if (_MSC_VER <= 1200)
Enable3dControls(); // Call this when using MFC in a shared DLL
#endif
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CDMOEnumDlg dlg;
m_pMainWnd = &dlg;
dlg.DoModal();
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "DMOEnum"=.\DMOEnum.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,55 @@
//------------------------------------------------------------------------------
// File: DMOEnum.h
//
// Desc: DirectShow sample code - main header file for the DMOEnum application.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#if !defined(AFX_DMOENUM_H__19FC7D3C_E963_41C9_AA3F_1330728D4F41__INCLUDED_)
#define AFX_DMOENUM_H__19FC7D3C_E963_41C9_AA3F_1330728D4F41__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumApp:
// See DMOEnum.cpp for the implementation of this class
//
class CDMOEnumApp : public CWinApp
{
public:
CDMOEnumApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDMOEnumApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CDMOEnumApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DMOENUM_H__19FC7D3C_E963_41C9_AA3F_1330728D4F41__INCLUDED_)

View File

@@ -0,0 +1,250 @@
# Microsoft Developer Studio Generated NMAKE File, Based on DMOEnum.dsp
!IF "$(CFG)" == ""
CFG=DMOEnum - Win32 Debug
!MESSAGE No configuration specified. Defaulting to DMOEnum - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "DMOEnum - Win32 Release" && "$(CFG)" != "DMOEnum - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "DMOEnum.mak" CFG="DMOEnum - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "DMOEnum - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "DMOEnum - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "DMOEnum - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
ALL : "$(OUTDIR)\DMOEnum.exe"
CLEAN :
-@erase "$(INTDIR)\DMOEnum.obj"
-@erase "$(INTDIR)\DMOEnum.pch"
-@erase "$(INTDIR)\DMOEnum.res"
-@erase "$(INTDIR)\DMOEnumDlg.obj"
-@erase "$(INTDIR)\namedguid.obj"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\DMOEnum.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\DMOEnum.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\DMOEnum.res" /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\DMOEnum.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=strmiids.lib msdmo.lib dmoguids.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\DMOEnum.pdb" /machine:I386 /out:"$(OUTDIR)\DMOEnum.exe" /stack:0x200000,0x200000
LINK32_OBJS= \
"$(INTDIR)\DMOEnum.obj" \
"$(INTDIR)\DMOEnumDlg.obj" \
"$(INTDIR)\namedguid.obj" \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\DMOEnum.res"
"$(OUTDIR)\DMOEnum.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "DMOEnum - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
ALL : "$(OUTDIR)\DMOEnum.exe"
CLEAN :
-@erase "$(INTDIR)\DMOEnum.obj"
-@erase "$(INTDIR)\DMOEnum.pch"
-@erase "$(INTDIR)\DMOEnum.res"
-@erase "$(INTDIR)\DMOEnumDlg.obj"
-@erase "$(INTDIR)\namedguid.obj"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\DMOEnum.exe"
-@erase "$(OUTDIR)\DMOEnum.ilk"
-@erase "$(OUTDIR)\DMOEnum.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\DMOEnum.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\DMOEnum.res" /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\DMOEnum.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=strmiids.lib msdmo.lib dmoguids.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\DMOEnum.pdb" /debug /machine:I386 /out:"$(OUTDIR)\DMOEnum.exe" /pdbtype:sept /stack:0x200000,0x200000
LINK32_OBJS= \
"$(INTDIR)\DMOEnum.obj" \
"$(INTDIR)\DMOEnumDlg.obj" \
"$(INTDIR)\namedguid.obj" \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\DMOEnum.res"
"$(OUTDIR)\DMOEnum.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("DMOEnum.dep")
!INCLUDE "DMOEnum.dep"
!ELSE
!MESSAGE Warning: cannot find "DMOEnum.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "DMOEnum - Win32 Release" || "$(CFG)" == "DMOEnum - Win32 Debug"
SOURCE=.\DMOEnum.cpp
"$(INTDIR)\DMOEnum.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\DMOEnum.pch"
SOURCE=.\DMOEnum.rc
"$(INTDIR)\DMOEnum.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)
SOURCE=.\DMOEnumDlg.cpp
"$(INTDIR)\DMOEnumDlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\DMOEnum.pch"
SOURCE=..\..\Common\namedguid.cpp
"$(INTDIR)\namedguid.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\DMOEnum.pch"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\StdAfx.cpp
!IF "$(CFG)" == "DMOEnum - Win32 Release"
CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\DMOEnum.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\DMOEnum.pch" : $(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "DMOEnum - Win32 Debug"
CPP_SWITCHES=/nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /I "..\..\BaseClasses" /I "..\..\..\..\..\include" /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\DMOEnum.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\DMOEnum.pch" : $(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ENDIF
!ENDIF

View File

@@ -0,0 +1,841 @@
//------------------------------------------------------------------------------
// File: DMOEnumDlg.cpp
//
// Desc: DirectShow sample code - implementation of dialog for device
// enumeration.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include "stdafx.h"
#include "DMOEnum.h"
#include "DMOEnumDlg.h"
#include "mfcdmoutil.h"
#include "namedguid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumDlg dialog
CDMOEnumDlg::CDMOEnumDlg(CWnd* pParent /*=NULL*/)
: CDialog(CDMOEnumDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CDMOEnumDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CDMOEnumDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDMOEnumDlg)
DDX_Control(pDX, IDC_STATIC_OUT_TYPE, m_StrOutType);
DDX_Control(pDX, IDC_STATIC_OUT_SUBYTPE, m_StrOutSubtype);
DDX_Control(pDX, IDC_STATIC_IN_TYPE, m_StrInType);
DDX_Control(pDX, IDC_STATIC_IN_SUBTYPE, m_StrInSubtype);
DDX_Control(pDX, IDC_CHECK_OUT_SUPPORTS_QC, m_CheckOutQC);
DDX_Control(pDX, IDC_CHECK_IN_SUPPORTS_QC, m_CheckInQC);
DDX_Control(pDX, IDC_STATIC_IN_FORMAT, m_StrInFormat);
DDX_Control(pDX, IDC_STATIC_OUT_FORMAT, m_StrOutFormat);
DDX_Control(pDX, IDC_CHECK_OUT_FIXED, m_CheckOutFixedSize);
DDX_Control(pDX, IDC_CHECK_OUT_WHOLE_SAMPLES, m_CheckOutWholeSamples);
DDX_Control(pDX, IDC_CHECK_OUT_OPTIONAL, m_CheckOutOptional);
DDX_Control(pDX, IDC_CHECK_OUT_ONESAMPLE, m_CheckOutOneSample);
DDX_Control(pDX, IDC_CHECK_OUT_DISCARDABLE, m_CheckOutDiscardable);
DDX_Control(pDX, IDC_CHECK_IN_WHOLE_SAMPLES, m_CheckInWholeSamples);
DDX_Control(pDX, IDC_CHECK_IN_ONESAMPLE, m_CheckInOneSample);
DDX_Control(pDX, IDC_CHECK_IN_HOLDSBUFFERS, m_CheckInHoldsBuffers);
DDX_Control(pDX, IDC_CHECK_IN_FIXED, m_CheckInFixedSize);
DDX_Control(pDX, IDC_STATIC_OUTPUT_STREAMS, m_nOutputStreams);
DDX_Control(pDX, IDC_STATIC_INPUT_STREAMS, m_nInputStreams);
DDX_Control(pDX, IDC_LIST_OUTPUT_STREAMS, m_ListOutputStreams);
DDX_Control(pDX, IDC_LIST_INPUT_STREAMS, m_ListInputStreams);
DDX_Control(pDX, IDC_STATIC_NUM_OTYPES, m_nOutputTypes);
DDX_Control(pDX, IDC_STATIC_NUM_ITYPES, m_nInputTypes);
DDX_Control(pDX, IDC_LIST_OUTPUT_TYPES, m_ListOutputTypes);
DDX_Control(pDX, IDC_LIST_INPUT_TYPES, m_ListInputTypes);
DDX_Control(pDX, IDC_CHECK_KEYED, m_bCheckKeyed);
DDX_Control(pDX, IDC_STATIC_FILENAME, m_StrFilename);
DDX_Control(pDX, IDC_STATIC_FILTERS, m_StrFilters);
DDX_Control(pDX, IDC_STATIC_CLASSES, m_StrClasses);
DDX_Control(pDX, IDC_LIST_FILTERS, m_FilterList);
DDX_Control(pDX, IDC_LIST_DEVICES, m_DeviceList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDMOEnumDlg, CDialog)
//{{AFX_MSG_MAP(CDMOEnumDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_LBN_SELCHANGE(IDC_LIST_DEVICES, OnSelchangeListDevices)
ON_WM_CLOSE()
ON_LBN_SELCHANGE(IDC_LIST_FILTERS, OnSelchangeListFilters)
ON_BN_CLICKED(IDC_CHECK_KEYED, OnCheckKeyed)
ON_LBN_SELCHANGE(IDC_LIST_INPUT_STREAMS, OnSelchangeListInputStreams)
ON_LBN_SELCHANGE(IDC_LIST_OUTPUT_STREAMS, OnSelchangeListOutputStreams)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumDlg message handlers
void CDMOEnumDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CDMOEnumDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
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;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CDMOEnumDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
BOOL CDMOEnumDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
////////////////////////////////////////////////////////////////////////
//
// DirectShow-specific initialization code
CoInitialize(NULL);
m_pDMO=0;
m_pGB=0;
// Include keyed DMOs in our search by default
m_bCheckKeyed.SetCheck(TRUE);
// Enumerate and display the DMO category list
FillCategoryList();
return TRUE; // return TRUE unless you set the focus to a control
}
void CDMOEnumDlg::FillCategoryList(void)
{
// Clear listboxes
ClearDeviceList();
ClearFilterList();
// Fill the category list box with the categories to display,
// using the names stored in the DMO_CATEGORY_INFO array.
// See DMOEnumDlg.H for a category description.
for (int i=0; i < NUM_CATEGORIES; i++)
m_DeviceList.AddString(dmo_categories[i].szName);
// Update listbox title with number of classes
SetNumClasses(NUM_CATEGORIES);
// Select the first category to show useful information
m_DeviceList.SetCurSel(0);
OnSelchangeListDevices();
}
void CDMOEnumDlg::SetNumClasses(int nClasses)
{
TCHAR szClasses[64];
wsprintf(szClasses, TEXT("%s (%d found)\0"), STR_CLASSES, nClasses);
m_StrClasses.SetWindowText(szClasses);
}
void CDMOEnumDlg::SetNumFilters(int nFilters)
{
TCHAR szFilters[64];
if (nFilters)
wsprintf(szFilters, TEXT("%s (%d found)\0"), STR_FILTERS, nFilters);
else
wsprintf(szFilters, TEXT("%s\0"), STR_FILTERS);
m_StrFilters.SetWindowText(szFilters);
}
void CDMOEnumDlg::OnCheckKeyed()
{
// Reenumerate the related filters, since the list may
// have changed to add or removed keyed filters.
OnSelchangeListDevices();
}
void CDMOEnumDlg::ClearDeviceList(void)
{
// Clean up
m_DeviceList.ResetContent();
SetNumClasses(0);
}
void CDMOEnumDlg::ClearFilterList(void)
{
CLSID *pStoredId = NULL;
int nCount = m_FilterList.GetCount();
// Delete any CLSID pointers that were stored in the listbox item data
for (int i=0; i < nCount; i++)
{
pStoredId = (CLSID *) m_FilterList.GetItemDataPtr(i);
if (pStoredId != 0)
{
delete pStoredId;
pStoredId = NULL;
}
}
// Clean up
m_FilterList.ResetContent();
SetNumFilters(0);
m_StrFilename.SetWindowText(TEXT("<No DMO selected>"));
}
void CDMOEnumDlg::ClearTypeLists(void)
{
// Clear the type boxes
m_ListInputTypes.ResetContent();
m_ListOutputTypes.ResetContent();
m_nInputTypes.SetWindowText(TEXT("0\0"));
m_nOutputTypes.SetWindowText(TEXT("0\0"));
}
void CDMOEnumDlg::OnClose()
{
// Free any stored CLSID pointers (in listbox item data ptr area)
ReleaseDMO();
ClearFilterList();
ClearDeviceList();
CoUninitialize();
CDialog::OnClose();
}
void CDMOEnumDlg::ReleaseDMO(void)
{
SAFE_RELEASE(m_pDMO);
SAFE_RELEASE(m_pGB);
// Clear any information set on the dialog for the last DMO
ClearDMOInfo();
}
void CDMOEnumDlg::ClearDMOInfo()
{
// Clear DMO-specific information
m_ListInputStreams.ResetContent();
m_ListOutputStreams.ResetContent();
m_nInputStreams.SetWindowText(TEXT("In Streams: 0\0"));
m_nOutputStreams.SetWindowText(TEXT("Out Streams: 0\0"));
// Input settings
m_CheckInWholeSamples.SetCheck(FALSE);
m_CheckInOneSample.SetCheck(FALSE);
m_CheckInFixedSize.SetCheck(FALSE);
m_CheckInHoldsBuffers.SetCheck(FALSE);
m_StrInFormat.SetWindowText(STR_UNKNOWN);
m_StrInType.SetWindowText(STR_UNKNOWN);
m_StrInSubtype.SetWindowText(STR_UNKNOWN);
m_CheckInQC.SetCheck(FALSE);
// Output settings
m_CheckOutWholeSamples.SetCheck(FALSE);
m_CheckOutOneSample.SetCheck(FALSE);
m_CheckOutFixedSize.SetCheck(FALSE);
m_CheckOutDiscardable.SetCheck(FALSE);
m_CheckOutOptional.SetCheck(FALSE);
m_StrOutFormat.SetWindowText(STR_UNKNOWN);
m_StrOutType.SetWindowText(STR_UNKNOWN);
m_StrOutSubtype.SetWindowText(STR_UNKNOWN);
m_CheckOutQC.SetCheck(FALSE);
}
void CDMOEnumDlg::OnSelchangeListFilters()
{
const CLSID *clsid;
// Get the currently selected category name
int nItem = m_FilterList.GetCurSel();
// Read the CLSID pointer from the list box's item data
clsid = (CLSID *) m_FilterList.GetItemDataPtr(nItem);
// Find the filter filename in the registry (by CLSID)
if (clsid != 0)
{
// Display the DMO's server filename
ShowFilenameByCLSID(*clsid);
// Show media types/subtypes used by this DMO
AddTypeInfo(clsid);
// Display DMO-specific information
ReleaseDMO();
ShowSelectedDMOInfo(clsid);
}
}
void CDMOEnumDlg::OnSelchangeListDevices()
{
HRESULT hr;
IEnumDMO *pEnum = NULL;
DWORD dwFlags = m_bCheckKeyed.GetCheck() ? DMO_ENUMF_INCLUDE_KEYED : 0;
// Get the currently selected category name
int nItem = m_DeviceList.GetCurSel();
const GUID *clsid;
// Read the CLSID pointer from our hard-coded array of
// documented filter categories
clsid = dmo_categories[nItem].pclsid;
ClearTypeLists();
ReleaseDMO();
// Enumerate all DMOs of the selected category
hr = DMOEnum(*clsid, dwFlags, 0, NULL, 0, NULL, &pEnum);
if (FAILED(hr))
return;
// Enumerate all filters using the new category enumerator
hr = EnumDMOs(pEnum);
// Now that the DMOs (if any) are enumerated and added
// to the list, go ahead and select the first one.
m_FilterList.SetCurSel(0);
OnSelchangeListFilters();
SAFE_RELEASE(pEnum);
}
void CDMOEnumDlg::AddFilter(
const TCHAR *szFilterName,
const GUID *pCatGuid)
{
// Allocate a new CLSID, whose pointer will be stored in
// the listbox. When the listbox is cleared, these will be deleted.
CLSID *pclsid = new CLSID;
// Add the category name and a pointer to its CLSID to the list box
int nSuccess = m_FilterList.AddString(szFilterName);
int nIndexNew = m_FilterList.FindStringExact(-1, szFilterName);
if (pclsid)
{
*pclsid = *pCatGuid;
nSuccess = m_FilterList.SetItemDataPtr(nIndexNew, pclsid);
}
}
HRESULT CDMOEnumDlg::EnumDMOs(IEnumDMO *pEnumCat)
{
HRESULT hr=S_OK;
ULONG cFetched;
int nFilters=0;
WCHAR *wszName;
CLSID clsid;
// Clear the current filter list
ClearFilterList();
// If there are no filters of a requested type, show default string
if (!pEnumCat)
{
m_FilterList.AddString(TEXT("<< No entries >>"));
SetNumFilters(nFilters);
return S_FALSE;
}
// Enumerate all items associated with the moniker
while(pEnumCat->Next(1, &clsid, &wszName, &cFetched) == S_OK)
{
nFilters++;
CString str(wszName);
// Add this DMO's name and CLSID to the listbox
AddFilter(str, &clsid);
CoTaskMemFree(wszName);
}
// If no DMOs matched the query, show a default item
if (nFilters == 0)
m_FilterList.AddString(TEXT("<< No entries >>"));
// Update count of enumerated filters
SetNumFilters(nFilters);
return hr;
}
void CDMOEnumDlg::GetTypeSubtypeString(TCHAR *szCLSID, DMO_PARTIAL_MEDIATYPE& aList)
{
HRESULT hr;
CString strType, strSubtype;
int j;
LPOLESTR szType, szSubtype;
// Convert binary CLSIDs to readable versions
hr = StringFromCLSID(aList.type, &szType);
if(FAILED(hr))
return;
hr = StringFromCLSID(aList.subtype, &szSubtype);
if(FAILED(hr))
return;
// Set default type/subtype strings to their actual GUID values
strType = szType;
strSubtype = szSubtype;
// Find type GUID's name in the named guids table
j=0;
while (rgng[j].pguid != 0)
{
if(aList.type == *(rgng[j].pguid))
{
strType = rgng[j].psz; // Save type name
break;
}
j++;
}
// Find subtype GUID's name in the named guids table
j=0;
while (rgng[j].pguid != 0)
{
if(aList.subtype == *(rgng[j].pguid))
{
strSubtype = rgng[j].psz; // Save subtype name
break;
}
j++;
}
// Build a string with the type/subtype information.
// If a friendly name was found, it will be used.
// Otherwise, the type/subtype's raw GUID will be displayed.
wsprintf(szCLSID, TEXT("%s\t%s"), strType, strSubtype);
}
void CDMOEnumDlg::AddTypeInfo(const GUID *pCLSID)
{
const int NUM_PAIRS=20;
HRESULT hr;
DMO_PARTIAL_MEDIATYPE aInputTypes[NUM_PAIRS]={0},
aOutputTypes[NUM_PAIRS]={0};
ULONG ulNumInputsSupplied, ulNumOutputsSupplied;
ULONG ulNumInputTypes=NUM_PAIRS, ulNumOutputTypes=NUM_PAIRS, i;
TCHAR szCLSID[128];
// Clear the type/subtype GUID boxes
ClearTypeLists();
// Read type/subtype information
hr = DMOGetTypes(
*pCLSID,
ulNumInputTypes,
&ulNumInputsSupplied,
aInputTypes,
ulNumOutputTypes,
&ulNumOutputsSupplied,
aOutputTypes);
if (FAILED(hr))
return;
// Display the number of input/output type/subtype pairs found
TCHAR szNum[10];
wsprintf(szNum, TEXT("%d"), ulNumInputsSupplied);
m_nInputTypes.SetWindowText(szNum);
wsprintf(szNum, TEXT("%d"), ulNumOutputsSupplied);
m_nOutputTypes.SetWindowText(szNum);
// Show input type/subtype pairs
for (i=0; i<ulNumInputsSupplied; i++)
{
GetTypeSubtypeString(szCLSID, aInputTypes[i]);
m_ListInputTypes.AddString(szCLSID);
}
// Show output type/subtype pairs
for (i=0; i<ulNumOutputsSupplied; i++)
{
GetTypeSubtypeString(szCLSID, aOutputTypes[i]);
m_ListOutputTypes.AddString(szCLSID);
}
}
void CDMOEnumDlg::ShowFilenameByCLSID(REFCLSID clsid)
{
HRESULT hr;
LPOLESTR strCLSID;
// Convert binary CLSID to a readable version
hr = StringFromCLSID(clsid, &strCLSID);
if(SUCCEEDED(hr))
{
TCHAR szKey[512];
CString strQuery(strCLSID);
// Create key name for reading filename registry
wsprintf(szKey, TEXT("Software\\Classes\\CLSID\\%s\\InprocServer32\0"),
strQuery);
// Free memory associated with strCLSID (allocated in StringFromCLSID)
CoTaskMemFree(strCLSID);
HKEY hkeyFilter=0;
int rc=0;
// Open the CLSID key that contains information about the filter
rc = RegOpenKey(HKEY_LOCAL_MACHINE, szKey, &hkeyFilter);
if (rc == ERROR_SUCCESS)
{
DWORD dwSize=MAX_PATH;
BYTE pbFilename[MAX_PATH];
rc = RegQueryValueEx(hkeyFilter, NULL, // Read (Default) value
NULL, NULL, pbFilename, &dwSize);
if (rc == ERROR_SUCCESS)
{
TCHAR szFilename[MAX_PATH];
wsprintf(szFilename, TEXT("%s\0"), pbFilename);
m_StrFilename.SetWindowText(szFilename);
}
else
m_StrFilename.SetWindowText(TEXT("<Unknown>\0"));
rc = RegCloseKey(hkeyFilter);
}
}
}
void CDMOEnumDlg::GetFormatString(TCHAR *szFormat, DMO_MEDIA_TYPE *pType)
{
int i=0;
// Find format GUID's name in the named guids table
while (rgng[i].pguid != 0)
{
if(pType->formattype == *(rgng[i].pguid))
{
wsprintf(szFormat, TEXT("%s\0"), rgng[i].psz);
return;
}
i++;
}
// If we got here, there was no match
wsprintf(szFormat, TEXT("Format_None\0"));
}
void CDMOEnumDlg::GetGUIDString(TCHAR *szString, GUID *pGUID)
{
int i=0;
// Find GUID's name in the named guids table
while (rgng[i].pguid != 0)
{
if(*pGUID == *(rgng[i].pguid))
{
wsprintf(szString, TEXT("%s\0"), rgng[i].psz);
return;
}
i++;
}
// If we got here, there was no match
wsprintf(szString, TEXT("GUID_NULL\0"));
}
void CDMOEnumDlg::ShowSelectedDMOInfo(const GUID *pCLSID)
{
HRESULT hr;
TCHAR sz[64];
// Create an instance of the selected DMO
hr = CoCreateInstance(*pCLSID, NULL,
CLSCTX_INPROC, IID_IMediaObject,
(void **)&m_pDMO);
if (FAILED(hr))
{
MessageBeep(0);
return;
}
// Read and display information about its input/output streams
DWORD dwInStream=0, dwOutStream=0, dwCount;
hr = m_pDMO->GetStreamCount(&dwInStream, &dwOutStream);
if (FAILED(hr))
{
MessageBeep(0);
return;
}
// Display the number of streams used by this DMO
wsprintf(sz, TEXT("In Streams: %d"), dwInStream);
m_nInputStreams.SetWindowText(sz);
wsprintf(sz, TEXT("Out Streams: %d"), dwOutStream);
m_nOutputStreams.SetWindowText(sz);
// Fill stream list boxes
for (dwCount=0; dwCount < dwInStream; dwCount++)
{
wsprintf(sz, TEXT("In %d"), dwCount);
m_ListInputStreams.AddString(sz);
}
for (dwCount=0; dwCount < dwOutStream; dwCount++)
{
wsprintf(sz, TEXT("Out %d"), dwCount);
m_ListOutputStreams.AddString(sz);
}
// Select the first item in each list, if it exists
if (dwInStream > 0)
{
m_ListInputStreams.SetCurSel(0);
OnSelchangeListInputStreams();
}
if (dwOutStream > 0)
{
m_ListOutputStreams.SetCurSel(0);
OnSelchangeListOutputStreams();
}
}
void CDMOEnumDlg::OnSelchangeListInputStreams()
{
HRESULT hr;
TCHAR sz[64];
int nSel = m_ListInputStreams.GetCurSel();
DWORD dwFlags=0;
//
// Display relevant information about input stream
//
if (!m_pDMO)
return;
// Read input stream information flags
hr = m_pDMO->GetInputStreamInfo(nSel, &dwFlags);
if (FAILED(hr))
{
MessageBeep(0);
return;
}
// Set stream info checkboxes
m_CheckInWholeSamples.SetCheck(dwFlags & DMO_INPUT_STREAMF_WHOLE_SAMPLES);
m_CheckInOneSample.SetCheck(dwFlags & DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER);
m_CheckInFixedSize.SetCheck(dwFlags & DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE);
m_CheckInHoldsBuffers.SetCheck(dwFlags & DMO_INPUT_STREAMF_HOLDS_BUFFERS);
// Read preferred input type information. The media type/subtypes
// are arranged in order of preference, starting from zero.
DMO_MEDIA_TYPE dmt={0};
hr = m_pDMO->GetInputType(nSel, 0, &dmt);
if (SUCCEEDED(hr))
{
GetFormatString(sz, &dmt);
m_StrInFormat.SetWindowText(sz);
GetGUIDString(sz, &dmt.majortype);
m_StrInType.SetWindowText(sz);
GetGUIDString(sz, &dmt.subtype);
m_StrInSubtype.SetWindowText(sz);
MoFreeMediaType(&dmt);
}
// Does this DMO support quality control?
IDMOQualityControl *pQC=0;
hr = m_pDMO->QueryInterface(IID_IDMOQualityControl, (void **) &pQC);
if (SUCCEEDED(hr))
{
m_CheckInQC.SetCheck(TRUE);
pQC->Release();
}
}
void CDMOEnumDlg::OnSelchangeListOutputStreams()
{
HRESULT hr;
TCHAR sz[64];
int nSel = m_ListInputStreams.GetCurSel();
DWORD dwFlags=0;
//
// Display relevant information about output stream
//
if (!m_pDMO)
return;
// Read output stream information flags
hr = m_pDMO->GetOutputStreamInfo(nSel, &dwFlags);
if (FAILED(hr))
{
MessageBeep(0);
return;
}
// Set stream info checkboxes
m_CheckOutWholeSamples.SetCheck(dwFlags & DMO_OUTPUT_STREAMF_WHOLE_SAMPLES);
m_CheckOutOneSample.SetCheck(dwFlags & DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER);
m_CheckOutFixedSize.SetCheck(dwFlags & DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE);
m_CheckOutDiscardable.SetCheck(dwFlags & DMO_OUTPUT_STREAMF_DISCARDABLE);
m_CheckOutOptional.SetCheck(dwFlags & DMO_OUTPUT_STREAMF_OPTIONAL);
// Read preferred output type information
DMO_MEDIA_TYPE dmt={0};
hr = m_pDMO->GetOutputType(nSel, 0, &dmt);
if (SUCCEEDED(hr))
{
GetFormatString(sz, &dmt);
m_StrOutFormat.SetWindowText(sz);
GetGUIDString(sz, &dmt.majortype);
m_StrOutType.SetWindowText(sz);
GetGUIDString(sz, &dmt.subtype);
m_StrOutSubtype.SetWindowText(sz);
MoFreeMediaType(&dmt);
}
// Does this DMO support quality control?
IDMOQualityControl *pQC=0;
hr = m_pDMO->QueryInterface(IID_IDMOQualityControl, (void **) &pQC);
if (SUCCEEDED(hr))
{
m_CheckOutQC.SetCheck(TRUE);
pQC->Release();
}
}

View File

@@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// File: DMOEnumDlg.h
//
// Desc: DirectShow sample code - header file for device enumeration dialog.
//
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include <dshow.h>
#include <dmo.h>
#if !defined(AFX_DMOENUMDLG_H__A96832BF_0309_4844_9B33_5E72285C3F3E__INCLUDED_)
#define AFX_DMOENUMDLG_H__A96832BF_0309_4844_9B33_5E72285C3F3E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//
// Macros
//
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
/////////////////////////////////////////////////////////////////////////////
// CDMOEnumDlg dialog
class CDMOEnumDlg : public CDialog
{
// Construction
public:
CDMOEnumDlg(CWnd* pParent = NULL); // standard constructor
HRESULT EnumDMOs(IEnumDMO *pEnumDMO);
void FillCategoryList(void);
void DisplayFullCategorySet(void);
void AddFilterCategory(const TCHAR *szCatDesc, const GUID *pCatGuid);
void AddFilter(const TCHAR *szFilterName, const GUID *pCatGuid);
void AddTypeInfo(const GUID *pCLSID);
void ShowSelectedDMOInfo(const GUID *pCLSID);
void ClearDMOInfo(void);
void ClearDeviceList(void);
void ClearFilterList(void);
void ClearTypeLists(void);
void SetNumClasses(int nClasses);
void SetNumFilters(int nFilters);
void ShowFilenameByCLSID(REFCLSID clsid);
void ReleaseDMO(void);
void GetFormatString(TCHAR *szFormat, DMO_MEDIA_TYPE *pType);
void GetGUIDString(TCHAR *szString, GUID *pGUID);
void GetTypeSubtypeString(TCHAR *szCLSID, DMO_PARTIAL_MEDIATYPE& aList);
// Dialog Data
//{{AFX_DATA(CDMOEnumDlg)
enum { IDD = IDD_DMOENUM_DIALOG };
CStatic m_StrOutType;
CStatic m_StrOutSubtype;
CStatic m_StrInType;
CStatic m_StrInSubtype;
CButton m_CheckOutQC;
CButton m_CheckInQC;
CStatic m_StrInFormat;
CStatic m_StrOutFormat;
CButton m_CheckOutFixedSize;
CButton m_CheckOutWholeSamples;
CButton m_CheckOutOptional;
CButton m_CheckOutOneSample;
CButton m_CheckOutDiscardable;
CButton m_CheckInWholeSamples;
CButton m_CheckInOneSample;
CButton m_CheckInHoldsBuffers;
CButton m_CheckInFixedSize;
CStatic m_nOutputStreams;
CStatic m_nInputStreams;
CListBox m_ListOutputStreams;
CListBox m_ListInputStreams;
CStatic m_nOutputTypes;
CStatic m_nInputTypes;
CListBox m_ListOutputTypes;
CListBox m_ListInputTypes;
CButton m_bCheckKeyed;
CStatic m_StrFilename;
CStatic m_StrFilters;
CStatic m_StrClasses;
CListBox m_FilterList;
CListBox m_DeviceList;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDMOEnumDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
IMediaObject *m_pDMO;
IGraphBuilder *m_pGB;
// Generated message map functions
//{{AFX_MSG(CDMOEnumDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSelchangeListDevices();
afx_msg void OnClose();
afx_msg void OnCheckShowall();
afx_msg void OnSelchangeListFilters();
afx_msg void OnCheckKeyed();
afx_msg void OnSelchangeListInputStreams();
afx_msg void OnSelchangeListOutputStreams();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DMOENUMDLG_H__A96832BF_0309_4844_9B33_5E72285C3F3E__INCLUDED_)

View File

@@ -0,0 +1,17 @@
DirectShow Sample -- DMOEnum
----------------------------
This sample demonstrates the use of the DMOEnum, IEnumDMO, and IMediaObject
interfaces to enumerate and read information about DirectX Media Objects
installed on your system. You may view all DMOs or only those that are not
keyed by checking the "Include Keyed DMOs?" checkbox.
When you select a DMO category, DMOEnum will enumerate all installed DMOs
that relate to the selected category. When you select a DMO in the list,
its server filename will be displayed. The media types and subtypes supported
by the DMO will be displayed in listboxes, and the DMO's preferred input/output
media type, subtype, and media format will be displayed on the right. The
input/output check boxes will also display stream information flags available
through IMediaObject::GetInputStreamInfo() (and GetOutputStreamInfo()).

View File

@@ -0,0 +1,59 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by DMOEnum.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_DMOENUM_DIALOG 102
#define IDR_MAINFRAME 128
#define IDC_LIST_DEVICES 1000
#define IDC_CHECK_SHOWALL 1001
#define IDC_LIST_FILTERS 1002
#define IDC_STATIC_CLASSES 1003
#define IDC_STATIC_FILTERS 1004
#define IDC_CHECK_KEYED 1005
#define IDC_STATIC_FILENAME 1006
#define IDC_LIST_INPUT_TYPES 1007
#define IDC_LIST_OUTPUT_TYPES 1008
#define IDC_STATIC_NUM_ITYPES 1009
#define IDC_LIST_INPUT_STREAMS 1010
#define IDC_LIST_OUTPUT_STREAMS 1011
#define IDC_STATIC_NUM_OTYPES 1012
#define IDC_STATIC_INPUT_STREAMS 1013
#define IDC_STATIC_OUTPUT_STREAMS 1014
#define IDC_STATIC_MAXLATENCY 1015
#define IDC_CHECK_IN_WHOLE_SAMPLES 1016
#define IDC_CHECK_IN_ONESAMPLE 1017
#define IDC_CHECK_IN_HOLDSBUFFERS 1018
#define IDC_CHECK_IN_FIXED 1019
#define IDC_CHECK_OUT_WHOLE_SAMPLES 1020
#define IDC_CHECK_OUT_ONESAMPLE 1021
#define IDC_CHECK_OUT_DISCARDABLE 1022
#define IDC_CHECK_OUT_FIXED 1023
#define IDC_CHECK_OUT_OPTIONAL 1024
#define IDC_STATIC_IN_MINBUFFERSIZE 1025
#define IDC_STATIC_IN_ALIGNMENT 1026
#define IDC_STATIC_IN_MAXLOOKAHEAD 1027
#define IDC_STATIC_OUT_MINBUFFERSIZE 1028
#define IDC_STATIC_OUT_ALIGNMENT 1029
#define IDC_STATIC_IN_TYPE 1030
#define IDC_STATIC_OUT_TYPE 1031
#define IDC_CHECK_IN_SUPPORTS_QC 1032
#define IDC_CHECK_OUT_SUPPORTS_QC 1033
#define IDC_STATIC_IN_SUBTYPE 1034
#define IDC_STATIC_OUT_SUBYTPE 1035
#define IDC_STATIC_IN_FORMAT 1036
#define IDC_STATIC_OUT_FORMAT 1037
#define IDC_STATIC_IN_MINBUFFERSIZE2 1038
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1031
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif